Browse Source

多语言维护

master
TML 4 years ago
parent
commit
ce9d28f307
  1. 361
      SCP/Views/BasicData/SCP_LANGUAGE.aspx.cs
  2. 4
      SCP/Views/BasicData/SCP_LANGUAGE_1.aspx
  3. 43
      SCP/Views/BasicData/SCP_LANGUAGE_DETAIL.aspx
  4. 26
      SCP/Views/BasicData/SCP_LANGUAGE_DETAIL.aspx.cs
  5. 44
      SCP/Views/BasicData/SCP_LANGUAGE_DETAIL.aspx.designer.cs

361
SCP/Views/BasicData/SCP_LANGUAGE.aspx.cs

@ -13,197 +13,198 @@ namespace SCP.BasicData
{
public partial class SCP_LANGUAGE : PageBase
{
private List<TA_LANGUAGE> _list=new List<TA_LANGUAGE>();
public int num;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindData();
}
}
public void BindData()
{
_list = SearchData();
var list = Sort<TA_LANGUAGE>(_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)
//{
// private List<TA_LANGUAGE> _list=new List<TA_LANGUAGE>();
// public int num;
// protected void Page_Load(object sender, EventArgs e)
// {
// if (!IsPostBack)
// {
// BindData();
// }
// }
// public void BindData()
// {
// _list = SearchData();
// var list = Sort<TA_LANGUAGE>(_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<TA_LANGUAGE>(_list.AsQueryable(), Grid_TA_LANGUAGE).ToList();
// // Dictionary<string, string> cellheader = new Dictionary<string, string>(){
// // { "AddressNo", "地点编号" },
// // { "Region", "所属区域" },
// // { "AccountingUnit", "会计单位" },
// // { "AddressDescription", "地点描述" }
// //};
// // string url = EntityListToExcel2003(cellheader, list, "地址");
// //}
// }
// //查询
// protected void btnSearch_OnClick(object sender, EventArgs e)
// {
// BindData();
// }
// //public List<TA_LANGUAGE> 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<TA_LANGUAGE>();
// // }
// // 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<TA_LANGUAGE>(_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<Int32>(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<Boolean>(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<TA_LANGUAGE>() { _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<TA_LANGUAGE>(_list.AsQueryable(), Grid_TA_LANGUAGE).ToList();
// Dictionary<string, string> cellheader = new Dictionary<string, string>(){
// { "AddressNo", "地点编号" },
// { "Region", "所属区域" },
// { "AccountingUnit", "会计单位" },
// { "AddressDescription", "地点描述" }
//};
// string url = EntityListToExcel2003(cellheader, list, "地址");
//}
}
// var list = Sort<TA_LANGUAGE>(_list.AsQueryable(), Grid_TA_LANGUAGE);
// Grid_TA_LANGUAGE.DataSource = list;
// Grid_TA_LANGUAGE.RecordCount = list.Count();
// Grid_TA_LANGUAGE.DataBind();
//查询
protected void btnSearch_OnClick(object sender, EventArgs e)
{
BindData();
}
public List<TA_LANGUAGE> 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<TA_LANGUAGE>();
}
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<TA_LANGUAGE>(_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 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<Int32>(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<Boolean>(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<TA_LANGUAGE>() { _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<TA_LANGUAGE>(_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)
//{
// protected void BtnSearch_Click(object sender, EventArgs e)
// {
// BindData();
// }
//}
}
protected void BtnSearch_Click(object sender, EventArgs e)
{
BindData();
}
}
}

4
SCP/Views/BasicData/SCP_LANGUAGE_1.aspx

@ -61,10 +61,8 @@
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<Columns >
<f:BoundField Width = "100px" DataField = "UID" DataFormatString = "{0}" HeaderText = "" Hidden="true"/>
<f:BoundField Width = "80px" DataField = "CH" DataFormatString = "{0}" HeaderText = "中文"/>
<f:BoundField Width = "80px" DataField = "EN" DataFormatString = "{0}" HeaderText = "英文"/>
<f:BoundField Width = "100px" DataField = "RU" DataFormatString = "{0}" HeaderText ="俄文" />

43
SCP/Views/BasicData/SCP_LANGUAGE_DETAIL.aspx

@ -1,4 +1,4 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_LANGUAGE_DETAIL.aspx.cs" Inherits="SCP.Views.BasicData.SCP_LANGUAGE_DE_TAIL" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_LANGUAGE_DETAIL.aspx.cs" Inherits="SCP.Views.BasicData.SCP_LANGUAGE_DETAIL" %>
<!DOCTYPE html>
@ -9,8 +9,40 @@
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" CssClass="blockpanel" Margin="0px" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:Button ID="Btn_Save" runat="server" EnablePostBack="True" Text="保存" Icon="SystemSave" OnClick="Btn_Save_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Form runat="server" Title="" ID="F_PO_DETAIL" >
<Items>
<f:TextBox runat = "server" Label = "中文" EmptyText = "" ID = "TXT_CH" />
<f:TextBox runat = "server" Label = "英文" EmptyText = "" ID = "TXT_EN" />
<f:TextBox runat = "server" Label = "俄文" EmptyText = "" ID = "TXT_RU" />
<f:TextBox runat = "server" Label = "德文" EmptyText = "" ID = "TXT_DE" />
<f:TextBox runat = "server" Label = "法文" EmptyText = "" ID = "TXT_FR" />
<f:TextBox runat = "server" Label = "阿拉伯" EmptyText = "" ID = "TXT_AR" />
<f:TextBox runat = "server" Label = "日文" EmptyText = "" ID = "TXT_JP" />
</Items>
</f:Form>
</Items>
</f:Panel>
</form>
</body>
</html>
<%-- <form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Form ID="Panel1" Title="请输入需要增加的信息" runat="server" Width="600px" Height="400px"
<f:Form ID="Panel1" Title="" runat="server" Width="600px" Height="400px"
LabelAlign="Right" LabelWidth="80px"
BodyPadding="5" ShowBorder="true" ShowHeader="true" Layout="VBox">
<Items>
@ -23,7 +55,7 @@
<f:TextBox runat = "server" Label = "法文" EmptyText = "" ID = "TXT_FR" />
<f:TextBox runat = "server" Label = "阿拉伯" EmptyText = "" ID = "TXT_AR" />
<f:TextBox runat = "server" Label = "日文" EmptyText = "" ID = "TXT_JP" />
<f:Button ID="Btn_Save" runat="server" EnablePostBack="True" Text="保存" Icon="SystemSave" OnClick="Btn_Save_Click" >
<f:Button ID="Btn_Save" runat="server" EnablePostBack="True" Text="保存" Icon="SystemSave" OnClick="Btn_Save_Click" Width="200px">
</f:Button>
</Items>
</f:Form>
@ -31,3 +63,8 @@
</body>
</html>
</form>
</body>
</html>--%>

26
SCP/Views/BasicData/SCP_LANGUAGE_DETAIL.aspx.cs

@ -25,16 +25,34 @@ using System.Drawing;
namespace SCP.Views.BasicData
{
public partial class SCP_LANGUAGE_DE_TAIL : System.Web.UI.Page
public partial class SCP_LANGUAGE_DETAIL : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Bind();
}
}
private void Bind()
{
if (!string.IsNullOrEmpty(Request["CH"]))
{
TA_LANGUAGE _entity = new TA_LANGUAGE();
_entity.CH = Request["CH"];
_entity.EN = Request["EN"];
TXT_CH.Text = _entity.CH;
TXT_EN.Text = _entity.EN;
var ret = SCP_TA_LANGUAGE_CONTROLLER.Get_TA_LANGUAGE_List(_entity);
}
}
protected void Btn_Save_Click(object sender, EventArgs e)
{
TA_LANGUAGE _entity = new TA_LANGUAGE();
_entity.GUID = TXT_GUID.Text;
_entity.GUID = Guid.NewGuid().ToString("N").ToUpper();
_entity.CH = TXT_CH.Text;
_entity.EN = TXT_EN.Text;
_entity.RU = TXT_RU.Text;
@ -42,7 +60,7 @@ namespace SCP.Views.BasicData
_entity.FR = TXT_FR.Text;
_entity.AR = TXT_AR.Text;
_entity.JP = TXT_JP.Text;
var ret = SCP_TA_LANGUAGE_CONTROLLER.Get_TA_LANGUAGE_List(new TA_LANGUAGE { CH = TXT_CH.Text });
var ret = SCP_TA_LANGUAGE_CONTROLLER.Get_TA_LANGUAGE_List(new TA_LANGUAGE { CH = TXT_CH.Text, EN = TXT_EN.Text });
if (ret.State == ReturnStatus.Succeed)
{
@ -56,7 +74,7 @@ namespace SCP.Views.BasicData
var ret1 = SCP_TA_LANGUAGE_CONTROLLER.Save_TA_LANGUAGE(new List<TA_LANGUAGE>() { _entity });
if (ret1.State == ReturnStatus.Succeed)
{
Alert.Show("保存成功");
}
}

44
SCP/Views/BasicData/SCP_LANGUAGE_DETAIL.aspx.designer.cs

@ -11,7 +11,7 @@ namespace SCP.Views.BasicData
{
public partial class SCP_LANGUAGE_DE_TAIL
public partial class SCP_LANGUAGE_DETAIL
{
/// <summary>
@ -23,6 +23,15 @@ namespace SCP.Views.BasicData
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
@ -30,16 +39,34 @@ namespace SCP.Views.BasicData
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Form Panel1;
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// Btn_Save 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Btn_Save;
/// <summary>
/// TXT_GUID 控件。
/// F_PO_DETAIL 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_GUID;
protected global::FineUI.Form F_PO_DETAIL;
/// <summary>
/// TXT_CH 控件。
@ -103,14 +130,5 @@ namespace SCP.Views.BasicData
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_JP;
/// <summary>
/// Btn_Save 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Btn_Save;
}
}

Loading…
Cancel
Save