diff --git a/SCP/Views/BasicData/SCP_LANGUAGE.aspx.cs b/SCP/Views/BasicData/SCP_LANGUAGE.aspx.cs index afe2987..e292e71 100644 --- a/SCP/Views/BasicData/SCP_LANGUAGE.aspx.cs +++ b/SCP/Views/BasicData/SCP_LANGUAGE.aspx.cs @@ -13,197 +13,198 @@ namespace SCP.BasicData { public partial class SCP_LANGUAGE : PageBase { - private List _list=new List(); - public int num; - protected void Page_Load(object sender, EventArgs e) - { - if (!IsPostBack) - { - BindData(); - } - } - - public void BindData() - { - _list = SearchData(); - var list = Sort(_list.AsQueryable(), Grid_TA_LANGUAGE); - Grid_TA_LANGUAGE.DataSource = list; - Grid_TA_LANGUAGE.RecordCount = list.Count(); - Grid_TA_LANGUAGE.DataBind(); - } - - //导出 - public void BtnOutPut_OnClick(object sender, EventArgs e) - { - //var _ret = Controller.SCP_TA_LANGUAGE_CONTROLLER.Get_TA_LANGUAGE_List(new TA_LANGUAGE()); - //if (_ret.State == ReturnStatus.Succeed) - //{ - // _list = _ret.Result; - // var list = Sort(_list.AsQueryable(), Grid_TA_LANGUAGE).ToList(); - - // Dictionary cellheader = new Dictionary(){ - // { "AddressNo", "地点编号" }, - // { "Region", "所属区域" }, - // { "AccountingUnit", "会计单位" }, - // { "AddressDescription", "地点描述" } - //}; - // string url = EntityListToExcel2003(cellheader, list, "地址"); - //} - } - - //查询 - protected void btnSearch_OnClick(object sender, EventArgs e) - { - BindData(); - } - public List SearchData() - { - TA_LANGUAGE _entity = new TA_LANGUAGE(); - _entity.GUID = TXT_GUID.Text; - _entity.CH = TXT_CH.Text; - - var _ret =SCP_TA_LANGUAGE_CONTROLLER.Get_TA_LANGUAGE_List(_entity); - if (_ret.State == ReturnStatus.Succeed) - { - _list = _ret.Result; - - } - else - { - _list = new List(); - } - - return _list; - - } - //显示 - protected void btnShow_OnClick(object sender, EventArgs e) - { - //gp1.Hidden = false; - } - //关闭 - protected void btnClose_OnClick(object sender, EventArgs e) - { - //gp1.Hidden = true; - } - - protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e) - { - Grid_TA_LANGUAGE.PageIndex = e.NewPageIndex; - } - - protected void Grid1_OnSort(object sender, GridSortEventArgs e) - { - - _list = SearchData(); - var list = Sort(_list.AsQueryable(), Grid_TA_LANGUAGE); - Grid_TA_LANGUAGE.DataSource = list; - Grid_TA_LANGUAGE.RecordCount = list.Count(); - Grid_TA_LANGUAGE.DataBind(); - } - - protected void Btn_Add_Click(object sender, EventArgs e) - { - - TXT_GUID.Text=Guid.NewGuid().ToString("N").ToUpper(); - TXT_CH.Text=string.Empty; - TXT_EN.Text=string.Empty; - TXT_RU.Text=string.Empty; - TXT_DE.Text=string.Empty; - TXT_FR.Text=string.Empty; - TXT_AR.Text=string.Empty; - TXT_JP.Text = string.Empty; - CB_IsDeleted.Checked = false; - - } - - protected void Grid_TA_LANGUAGE_RowSelect(object sender, GridRowSelectEventArgs e) - { - object[] rowDataKeys = Grid_TA_LANGUAGE.DataKeys[e.RowIndex]; - TA_LANGUAGE _entity = new TA_LANGUAGE(); - _entity.UID = ConvertHelper.To(rowDataKeys[0]); - _entity.GUID = rowDataKeys[1] as string; - _entity.CH = rowDataKeys[2] as string; - _entity.EN = rowDataKeys[3] as string; - _entity.RU = rowDataKeys[4] as string; - _entity.DE = rowDataKeys[5] as string; - _entity.FR = rowDataKeys[6] as string; - _entity.EL = rowDataKeys[7] as string; - _entity.AR = rowDataKeys[8] as string; - _entity.JP = rowDataKeys[9] as string; - _entity.IsDeleted = ConvertHelper.To(rowDataKeys[10]); - TXT_GUID.Text = _entity.GUID; - TXT_CH.Text = _entity.CH; - TXT_EN.Text = _entity.EN; - TXT_RU.Text = _entity.RU; - TXT_DE.Text = _entity.DE; - TXT_FR.Text = _entity.FR; - TXT_AR.Text = _entity.AR; - TXT_JP.Text = _entity.JP; - CB_IsDeleted.Checked = _entity.IsDeleted; - } - - - - protected void Btn_Save_Click(object sender, EventArgs e) - { - TA_LANGUAGE _entity = new TA_LANGUAGE(); - _entity.GUID = TXT_GUID.Text; - _entity.CH = TXT_CH.Text; - _entity.EN = TXT_EN.Text; - _entity.RU = TXT_RU.Text; - _entity.DE = TXT_DE.Text; - _entity.FR = TXT_FR.Text; - _entity.AR = TXT_AR.Text; - _entity.JP = TXT_JP.Text; - _entity.IsDeleted = CB_IsDeleted.Checked; - var ret=SCP_TA_LANGUAGE_CONTROLLER.Get_TA_LANGUAGE_List(new TA_LANGUAGE { CH = TXT_CH.Text }); - if (ret.State == ReturnStatus.Succeed) - { - - if (ret.Result.Count > 0) - { - Alert.ShowInTop("中文名称重复!"); - return; - } - else - { - var ret1 = SCP_TA_LANGUAGE_CONTROLLER.Save_TA_LANGUAGE(new List() { _entity }); - if (ret1.State == ReturnStatus.Succeed) - { - var _ret = SCP_TA_LANGUAGE_CONTROLLER.Get_TA_LANGUAGE_List(new TA_LANGUAGE()); - if (_ret.State == ReturnStatus.Succeed) - { - _list = _ret.Result; - var list = Sort(_list.AsQueryable(), Grid_TA_LANGUAGE); - Grid_TA_LANGUAGE.DataSource = list; - Grid_TA_LANGUAGE.RecordCount = list.Count(); - Grid_TA_LANGUAGE.DataBind(); - - } - } - - } - - } - - - } - - protected void Btn_Delete_Click(object sender, EventArgs e) - { - //var ret = SCP_TA_LANGUAGE_CONTROLLER.Del_TA_LANGUAGE(new TA_LANGUAGE { GUID = TXT_GUID.Text }); - //if (ret.State == ReturnStatus.Succeed) - //{ - // BindData(); - //} - - - } - - protected void BtnSearch_Click(object sender, EventArgs e) - { - BindData(); - } + // private List _list=new List(); + // public int num; + // protected void Page_Load(object sender, EventArgs e) + // { + // if (!IsPostBack) + // { + // BindData(); + // } + // } + + // public void BindData() + // { + // _list = SearchData(); + // var list = Sort(_list.AsQueryable(), Grid_TA_LANGUAGE); + // Grid_TA_LANGUAGE.DataSource = list; + // Grid_TA_LANGUAGE.RecordCount = list.Count(); + // Grid_TA_LANGUAGE.DataBind(); + // } + + // //导出 + // public void BtnOutPut_OnClick(object sender, EventArgs e) + // { + // //var _ret = Controller.SCP_TA_LANGUAGE_CONTROLLER.Get_TA_LANGUAGE_List(new TA_LANGUAGE()); + // //if (_ret.State == ReturnStatus.Succeed) + // //{ + // // _list = _ret.Result; + // // var list = Sort(_list.AsQueryable(), Grid_TA_LANGUAGE).ToList(); + + // // Dictionary cellheader = new Dictionary(){ + // // { "AddressNo", "地点编号" }, + // // { "Region", "所属区域" }, + // // { "AccountingUnit", "会计单位" }, + // // { "AddressDescription", "地点描述" } + // //}; + // // string url = EntityListToExcel2003(cellheader, list, "地址"); + // //} + // } + + // //查询 + // protected void btnSearch_OnClick(object sender, EventArgs e) + // { + // BindData(); + // } + // //public List SearchData() + // //{ + // // TA_LANGUAGE _entity = new TA_LANGUAGE(); + // // _entity.GUID = TXT_GUID.Text; + // // _entity.CH = TXT_CH.Text; + + // // var _ret =SCP_TA_LANGUAGE_CONTROLLER.Get_TA_LANGUAGE_List(_entity); + // // if (_ret.State == ReturnStatus.Succeed) + // // { + // // _list = _ret.Result; + + // // } + // // else + // // { + // // _list = new List(); + // // } + + // // return _list; + + // //} + // //显示 + // protected void btnShow_OnClick(object sender, EventArgs e) + // { + // //gp1.Hidden = false; + // } + // //关闭 + // protected void btnClose_OnClick(object sender, EventArgs e) + // { + // //gp1.Hidden = true; + // } + + // protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e) + // { + // Grid_TA_LANGUAGE.PageIndex = e.NewPageIndex; + // } + + // protected void Grid1_OnSort(object sender, GridSortEventArgs e) + // { + + // _list = SearchData(); + // var list = Sort(_list.AsQueryable(), Grid_TA_LANGUAGE); + // Grid_TA_LANGUAGE.DataSource = list; + // Grid_TA_LANGUAGE.RecordCount = list.Count(); + // Grid_TA_LANGUAGE.DataBind(); + // } + + // protected void Btn_Add_Click(object sender, EventArgs e) + // { + + // TXT_GUID.Text=Guid.NewGuid().ToString("N").ToUpper(); + // TXT_CH.Text=string.Empty; + // TXT_EN.Text=string.Empty; + // TXT_RU.Text=string.Empty; + // TXT_DE.Text=string.Empty; + // TXT_FR.Text=string.Empty; + // TXT_AR.Text=string.Empty; + // TXT_JP.Text = string.Empty; + // CB_IsDeleted.Checked = false; + + // } + + // protected void Grid_TA_LANGUAGE_RowSelect(object sender, GridRowSelectEventArgs e) + // { + // object[] rowDataKeys = Grid_TA_LANGUAGE.DataKeys[e.RowIndex]; + // TA_LANGUAGE _entity = new TA_LANGUAGE(); + // _entity.UID = ConvertHelper.To(rowDataKeys[0]); + // _entity.GUID = rowDataKeys[1] as string; + // _entity.CH = rowDataKeys[2] as string; + // _entity.EN = rowDataKeys[3] as string; + // _entity.RU = rowDataKeys[4] as string; + // _entity.DE = rowDataKeys[5] as string; + // _entity.FR = rowDataKeys[6] as string; + // _entity.EL = rowDataKeys[7] as string; + // _entity.AR = rowDataKeys[8] as string; + // _entity.JP = rowDataKeys[9] as string; + // _entity.IsDeleted = ConvertHelper.To(rowDataKeys[10]); + // TXT_GUID.Text = _entity.GUID; + // TXT_CH.Text = _entity.CH; + // TXT_EN.Text = _entity.EN; + // TXT_RU.Text = _entity.RU; + // TXT_DE.Text = _entity.DE; + // TXT_FR.Text = _entity.FR; + // TXT_AR.Text = _entity.AR; + // TXT_JP.Text = _entity.JP; + // CB_IsDeleted.Checked = _entity.IsDeleted; + // } + + + + // protected void Btn_Save_Click(object sender, EventArgs e) + // { + // TA_LANGUAGE _entity = new TA_LANGUAGE(); + // _entity.GUID = TXT_GUID.Text; + // _entity.CH = TXT_CH.Text; + // _entity.EN = TXT_EN.Text; + // _entity.RU = TXT_RU.Text; + // _entity.DE = TXT_DE.Text; + // _entity.FR = TXT_FR.Text; + // _entity.AR = TXT_AR.Text; + // _entity.JP = TXT_JP.Text; + // _entity.IsDeleted = CB_IsDeleted.Checked; + // var ret=SCP_TA_LANGUAGE_CONTROLLER.Get_TA_LANGUAGE_List(new TA_LANGUAGE { CH = TXT_CH.Text }); + // if (ret.State == ReturnStatus.Succeed) + // { + + // if (ret.Result.Count > 0) + // { + // Alert.ShowInTop("中文名称重复!"); + // return; + // } + // else + // { + // var ret1 = SCP_TA_LANGUAGE_CONTROLLER.Save_TA_LANGUAGE(new List() { _entity }); + // if (ret1.State == ReturnStatus.Succeed) + // { + // var _ret = SCP_TA_LANGUAGE_CONTROLLER.Get_TA_LANGUAGE_List(new TA_LANGUAGE()); + // if (_ret.State == ReturnStatus.Succeed) + // { + // _list = _ret.Result; + // var list = Sort(_list.AsQueryable(), Grid_TA_LANGUAGE); + // Grid_TA_LANGUAGE.DataSource = list; + // Grid_TA_LANGUAGE.RecordCount = list.Count(); + // Grid_TA_LANGUAGE.DataBind(); + + // } + // } + + // } + + // } + + + // } + + // protected void Btn_Delete_Click(object sender, EventArgs e) + // { + // //var ret = SCP_TA_LANGUAGE_CONTROLLER.Del_TA_LANGUAGE(new TA_LANGUAGE { GUID = TXT_GUID.Text }); + // //if (ret.State == ReturnStatus.Succeed) + // //{ + // // BindData(); + // //} + + + // } + + // protected void BtnSearch_Click(object sender, EventArgs e) + // { + // BindData(); + // } + //} } } \ No newline at end of file diff --git a/SCP/Views/BasicData/SCP_LANGUAGE_1.aspx b/SCP/Views/BasicData/SCP_LANGUAGE_1.aspx index 73becf7..bd6b1c2 100644 --- a/SCP/Views/BasicData/SCP_LANGUAGE_1.aspx +++ b/SCP/Views/BasicData/SCP_LANGUAGE_1.aspx @@ -61,11 +61,9 @@ - - +