本文整理汇总了C#中StoreSubmitDataEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# StoreSubmitDataEventArgs类的具体用法?C# StoreSubmitDataEventArgs怎么用?C# StoreSubmitDataEventArgs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StoreSubmitDataEventArgs类属于命名空间,在下文中一共展示了StoreSubmitDataEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToExcel_Click
protected void ToExcel_Click(object sender, EventArgs e)
{
string json = ExcelGridData.Value.ToString();
StoreSubmitDataEventArgs eSubmit = new StoreSubmitDataEventArgs(json, null);
XmlNode xml = eSubmit.Xml;
this.Response.Clear();
this.Response.ContentType = "application/vnd.ms-excel";
this.Response.AddHeader("Content-Disposition", "attachment; filename=SaleRank.xls");
XslCompiledTransform xtExcel = new XslCompiledTransform();
xtExcel.Load(Server.MapPath("./Styles/Excel.xsl"));
xtExcel.Transform(xml, null, this.Response.OutputStream);
this.Response.End();
}
示例2: ToCsv
protected void ToCsv(object sender, EventArgs e)
{
string json = GridData.Value.ToString();
StoreSubmitDataEventArgs eSubmit = new StoreSubmitDataEventArgs(json, null);
XmlNode xml = eSubmit.Xml;
this.Response.Clear();
this.Response.ContentType = "application/octet-stream";
this.Response.AddHeader("Content-Disposition", "attachment; filename=Reporte.csv");
XslCompiledTransform xtCsv = new XslCompiledTransform();
xtCsv.Load(Server.MapPath("/Docs/XSL/Csv.xsl"));
xtCsv.Transform(xml, null, this.Response.OutputStream);
this.Response.End();
}
示例3: ToXml
protected void ToXml(object sender, EventArgs e)
{
string json = GridData.Value.ToString();
StoreSubmitDataEventArgs eSubmit = new StoreSubmitDataEventArgs(json, null);
XmlNode xml = eSubmit.Xml;
string strXml = xml.OuterXml;
this.Response.Clear();
this.Response.AddHeader("Content-Disposition", "attachment; filename=Reporte.xml");
this.Response.AddHeader("Content-Length", strXml.Length.ToString());
this.Response.ContentType = "application/xml";
this.Response.Write(strXml);
this.Response.End();
}
示例4: SubmitData
protected void SubmitData(object sender, StoreSubmitDataEventArgs e)
{
string json = e.Json;
XmlNode xml = e.Xml;
List<Country> countries = e.Object<Country>();
StringBuilder sb = new StringBuilder(255);
sb.Append("<h3>Selected Countries</h3>");
foreach (Country country in countries)
{
sb.AppendFormat("{0}<br />", country.Name);
}
this.Label1.Html = sb.ToString();
}
示例5: SubmitData
protected void SubmitData(object sender, StoreSubmitDataEventArgs e)
{
string json = e.Json;
XmlNode xml = e.Xml;
List<Country> countries = e.Object<Country>();
StringBuilder sb = new StringBuilder(255);
sb.Append("Selected:");
foreach (Country country in countries)
{
sb.AppendFormat("{0},", country.ID);
}
this.txtTo1.Text = sb.ToString().Substring(0, sb.ToString().Length - 1);
}
示例6: OnSubmitData
protected virtual void OnSubmitData(StoreSubmitDataEventArgs e)
{
AjaxSubmitDataEventHandler handler = (AjaxSubmitDataEventHandler)Events[EventSubmitData];
if (handler != null)
{
handler(this, e);
}
}
示例7: RaiseAjaxPostBackEvent
private void RaiseAjaxPostBackEvent(string eventArgument)
{
try
{
if (eventArgument.IsEmpty())
{
throw new ArgumentNullException("eventArgument");
}
string data = null;
JToken parametersToken = null;
if (this.DirectConfig != null)
{
parametersToken = this.DirectConfig.SelectToken("config.extraParams", false);
JToken serviceToken = this.DirectConfig.SelectToken("config.serviceParams", false);
if (serviceToken != null)
{
data = JSON.ToString(serviceToken);
}
}
string action = eventArgument;
BeforeDirectEventArgs e = new BeforeDirectEventArgs(action, data, parametersToken);
this.OnAjaxPostBack(e);
if (this.AutoDecode && data.IsNotEmpty())
{
data = HttpUtility.HtmlDecode(data);
}
switch (action)
{
case "create":
case "destroy":
case "update":
case "batch":
if (data == null)
{
throw new InvalidOperationException("No data in request");
}
this.DoSaving(action, data, parametersToken);
break;
case "read":
StoreReadDataEventArgs refreshArgs = new StoreReadDataEventArgs(parametersToken);
this.OnReadData(refreshArgs);
PageProxy dsp = this.Proxy.Primary as PageProxy;
if (dsp != null)
{
if (refreshArgs.Total > -1)
{
dsp.Total = refreshArgs.Total;
}
}
break;
case "submit":
if (data == null)
{
throw new InvalidOperationException("No data in request");
}
StoreSubmitDataEventArgs args = new StoreSubmitDataEventArgs(data, parametersToken);
this.OnSubmitData(args);
break;
}
}
catch (Exception ex)
{
success = false;
msg = this.IsDebugging ? ex.ToString() : ex.Message;
if (this.ResourceManager.RethrowAjaxExceptions)
{
throw;
}
}
AfterDirectEventArgs eAjaxPostBackResult = new AfterDirectEventArgs(new Response(success, msg));
this.OnAjaxPostBackResult(eAjaxPostBackResult);
StoreResponseData response = new StoreResponseData();
if (eAjaxPostBackResult.Response.Success)
{
switch (eventArgument)
{
case "read":
if (this.RequiresDataBinding)
{
this.DataBind();
}
//.........这里部分代码省略.........
示例8: btnExport_Click
protected void btnExport_Click(object sender, EventArgs e)
{
XlsDocument xls = new XlsDocument();//新建一个xls文档
xls.FileName = DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
Worksheet sheet;
sheet = xls.Workbook.Worksheets.Add(DateTime.Now.ToString("yyyyMMddHHmmss"));
XF titleXF = xls.NewXF(); // 为xls生成一个XF实例,XF是单元格格式对象
titleXF.HorizontalAlignment = HorizontalAlignments.Left; // 设定文字居中
titleXF.VerticalAlignment = VerticalAlignments.Centered; // 垂直居中
titleXF.UseBorder = false; // 使用边框
titleXF.Font.Height = 12 * 20; // 字大小(字体大小是以 1/20 point 为单位的)
XF titleXF1 = xls.NewXF(); // 为xls生成一个XF实例,XF是单元格格式对象
titleXF1.HorizontalAlignment = HorizontalAlignments.Left; // 设定文字居中
titleXF1.VerticalAlignment = VerticalAlignments.Centered; // 垂直居中
titleXF1.UseBorder = false; // 使用边框
titleXF1.Font.Bold = true;
titleXF1.Font.Height = 12 * 20; // 字大小(字体大小是以 1/20 point 为单位的)
// 开始填充数据到单元格
org.in2bits.MyXls.Cells cells = sheet.Cells;
cells.Add(1, 1, "NO#", titleXF1);
cells.Add(1, 2, "Claim Type", titleXF1);
cells.Add(1, 3, "Amount", titleXF1);
cells.Add(1, 4, "Owner", titleXF1);
cells.Add(1, 5, "Process", titleXF1);
cells.Add(1, 6, "Current Approver", titleXF1);
cells.Add(1, 7, "Submit Date", titleXF1);
cells.Add(1, 8, "Remark", titleXF1);
//添加数据
string json = GridData.Value.ToString();
StoreSubmitDataEventArgs eSubmit = new StoreSubmitDataEventArgs(json, null);
XmlNode xml = eSubmit.Xml;
XmlDocument doc = new XmlDocument();
doc.LoadXml(xml.InnerXml);
for (int i = 0; i < doc.SelectNodes("records").Item(0).SelectNodes("record").Count; i++)
{
if (!string.IsNullOrEmpty(doc.SelectNodes("records").Item(0).SelectNodes("record").Item(i).SelectNodes("Tamount").Item(0).InnerXml))
{
cells.Add(2 + i, 3, Convert.ToDouble(doc.SelectNodes("records").Item(0).SelectNodes("record").Item(i).SelectNodes("Tamount").Item(0).InnerXml), titleXF);
}
else
{
cells.Add(2 + i, 3, "", titleXF);
}
cells.Add(2 + i, 1, doc.SelectNodes("records").Item(0).SelectNodes("record").Item(i).SelectNodes("No").Item(0).InnerXml, titleXF);
cells.Add(2 + i, 2, doc.SelectNodes("records").Item(0).SelectNodes("record").Item(i).SelectNodes("Type1").Item(0).InnerXml, titleXF);
cells.Add(2 + i, 4, doc.SelectNodes("records").Item(0).SelectNodes("record").Item(i).SelectNodes("Person").Item(0).InnerXml, titleXF);
cells.Add(2 + i, 5, doc.SelectNodes("records").Item(0).SelectNodes("record").Item(i).SelectNodes("Status1").Item(0).InnerXml, titleXF);
cells.Add(2 + i, 6, doc.SelectNodes("records").Item(0).SelectNodes("record").Item(i).SelectNodes("Approver").Item(0).InnerXml, titleXF);
cells.Add(2 + i, 7, doc.SelectNodes("records").Item(0).SelectNodes("record").Item(i).SelectNodes("CreadedDate").Item(0).InnerXml, titleXF);
cells.Add(2 + i, 8, doc.SelectNodes("records").Item(0).SelectNodes("record").Item(i).SelectNodes("Remark").Item(0).InnerXml, titleXF);
}
xls.Send();
}
示例9: SaveDetail
protected bool SaveDetail(string detail, string header0string, string header1string, string header2string, string Cur, string dept)
{
cs.DBCommand dbc = new cs.DBCommand();
//删除现有数据
string deletesql = "delete from ETraveleDetail where [No]='" + hdTravelRequestID.Value.ToString() + "'";
string newid1 = dbc.UpdateData("eReimbursement", deletesql, "Update");
SqlConnection sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["eReimbursement"].ConnectionString);
//如果出差站点为空,则不保存信息
StoreSubmitDataEventArgs eSubmit = new StoreSubmitDataEventArgs(detail, null);
XmlNode xml = eSubmit.Xml;
XmlDocument doc = new XmlDocument();
doc.LoadXml(xml.InnerXml);
int dtcol = doc.SelectNodes("records").Item(0).SelectNodes("record").Item(0).ChildNodes.Count;
//doc.SelectNodes("records").Item(0).SelectNodes("record").Item(i).ChildNodes[j].InnerText;
int dtrow = doc.SelectNodes("records").Item(0).SelectNodes("record").Count;
int groupcount = (dtcol - 3) / 2;//多少个站点会被更新,如果站点为空则不更新
decimal psum = 0, csum = 0;//记录该申请单的费用合计
for (int i = 0; i < groupcount; i++)
{
if (header0string.Split(',')[i] != "NA")//站点为空则不更新
{
DataSet ds2 = DIMERCO.SDK.Utilities.LSDK.getUserProfilebyUserList(hdOwnerID.Value.ToString());
string station = "",Tstation="";
if (ds2.Tables[0].Rows.Count == 1)
{
DataTable dt1 = ds2.Tables[0];
station = dt1.Rows[0]["stationCode"].ToString();
DataTable dttemp = new DataTable();
string sqltemp = "select * from ESUSER where Userid='" + hdOwnerID.Value.ToString() + "'";
dttemp = dbc.GetData("eReimbursement", sqltemp);
if (dttemp.Rows.Count > 0)
{
station = dttemp.Rows[0]["Station"].ToString();
}
}
Tstation = header1string.Split(',')[i] == "NA" ? station : header1string.Split(',')[i];
double re = System.Math.Round(DIMERCO.SDK.Utilities.LSDK.GetLatestStationUSDConvertRate(station) / DIMERCO.SDK.Utilities.LSDK.GetLatestStationUSDConvertRate(Tstation), 4);
//共新增11行固定数据
for (int j = 0; j < 11; j++)
{
try
{
SqlCommand scdetail = sqlConn.CreateCommand();
scdetail.CommandText = "insert into ETraveleDetail ([No],[Tocity],[AccountCode],[Cur],[Pamount],[Camount],[TSation],[Createdby],[CreadedDate],[Tdate],[Department1],[DetailCode],[Tdate0],[CenterAmountP],[CenterAmountC]) values (@No,@Tocity,@AccountCode,@Cur,@Pamount,@Camount,@TSation,@Createdby,@CreadedDate,@Tdate,@Department1,@DetailCode,@Tdate0,@CenterAmountP,@CenterAmountC)";
SqlParameter spdetail = new SqlParameter("@No", SqlDbType.VarChar, 50);
spdetail.Value = hdTravelRequestID.Value.ToString();
scdetail.Parameters.Add(spdetail);
spdetail = new SqlParameter("@Tocity", SqlDbType.VarChar, 10);
spdetail.Value = header0string.Split(',')[i];
scdetail.Parameters.Add(spdetail);
spdetail = new SqlParameter("@AccountCode", SqlDbType.VarChar, 50);
switch (j)
{
case 4:
spdetail.Value = "62010900";
break;
case 5:
spdetail.Value = "62011900";
break;
case 6:
spdetail.Value = "62010500";
break;
default:
spdetail.Value = "62012000";
break;
}
scdetail.Parameters.Add(spdetail);
spdetail = new SqlParameter("@Cur", SqlDbType.VarChar, 50);
spdetail.Value = Cur;
scdetail.Parameters.Add(spdetail);
spdetail = new SqlParameter("@Pamount", SqlDbType.Decimal);
if (doc.SelectNodes("records").Item(0).SelectNodes("record").Item(j).ChildNodes[1 + i * 2].InnerText != "")
{
spdetail.Value = System.Math.Round(Convert.ToDecimal(doc.SelectNodes("records").Item(0).SelectNodes("record").Item(j).ChildNodes[1 + i * 2].InnerText), 2);
psum += System.Math.Round(Convert.ToDecimal(doc.SelectNodes("records").Item(0).SelectNodes("record").Item(j).ChildNodes[1 + i * 2].InnerText), 2);
}
else
{
spdetail.Value = DBNull.Value;
}
scdetail.Parameters.Add(spdetail);
spdetail = new SqlParameter("@CenterAmountP", SqlDbType.Decimal);
if (doc.SelectNodes("records").Item(0).SelectNodes("record").Item(j).ChildNodes[1 + i * 2].InnerText != "")
{
spdetail.Value = Convert.ToDecimal(System.Math.Round(Convert.ToDouble(doc.SelectNodes("records").Item(0).SelectNodes("record").Item(j).ChildNodes[1 + i * 2].InnerText) * re, 2));
}
else
{
spdetail.Value = DBNull.Value;
}
scdetail.Parameters.Add(spdetail);
spdetail = new SqlParameter("@Camount", SqlDbType.Decimal);
//.........这里部分代码省略.........
示例10: SaveAll
//.........这里部分代码省略.........
return;
}
else
{
X.AddScript("Ext.Msg.show({ title: 'Message', msg: 'Please input valid Cost Center.', buttons: { ok: 'Ok' }, fn: function (btn) { } });");
return;
}
}
}
}
//140306
if (true)
{
DataTable dtbudget = new DataTable();
dtbudget.Columns.Add("EName", typeof(System.String));
dtbudget.Columns.Add("COACode", typeof(System.String));
dtbudget.Columns.Add("Current", typeof(System.Decimal));
dtbudget.Columns.Add("PU", typeof(System.Decimal));
dtbudget.Columns.Add("PB", typeof(System.Decimal));
dtbudget.Columns.Add("PPercent", typeof(System.Decimal));
dtbudget.Columns.Add("DU", typeof(System.Decimal));
dtbudget.Columns.Add("DB", typeof(System.Decimal));
dtbudget.Columns.Add("DPercent", typeof(System.Decimal));
dtbudget.Columns.Add("SU", typeof(System.Decimal));
dtbudget.Columns.Add("SB", typeof(System.Decimal));
dtbudget.Columns.Add("SPercent", typeof(System.Decimal));
DataTable dtA = new DataTable();
dtA.Columns.Add("COACode", typeof(System.String));
dtA.Columns.Add("Amount", typeof(System.Decimal));
dtA.Columns.Add("Date", typeof(System.DateTime));
StoreSubmitDataEventArgs eSubmit = new StoreSubmitDataEventArgs(detail, null);
XmlNode xml = eSubmit.Xml;
XmlDocument doc = new XmlDocument();
doc.LoadXml(xml.InnerXml);
int dtcol = doc.SelectNodes("records").Item(0).SelectNodes("record").Item(0).ChildNodes.Count;
int dtrow = doc.SelectNodes("records").Item(0).SelectNodes("record").Count;
int groupcount = (dtcol - 3) / 2;//多少个站点会被更新,如果站点为空则不更新
//string tstation = "", year = "", month = "", coacode = "";
for (int i = 0; i < groupcount; i++)
{
if (header0string.Split(',')[i] != "NA")//站点为空则不更新
{
//1. Air Ticket - Int'l
if ((doc.SelectNodes("records").Item(0).SelectNodes("record").Item(0).ChildNodes[1 + i * 2].InnerText != "" && Convert.ToDecimal(doc.SelectNodes("records").Item(0).SelectNodes("record").Item(0).ChildNodes[1 + i * 2].InnerText) != 0) || (doc.SelectNodes("records").Item(0).SelectNodes("record").Item(0).ChildNodes[2 + i * 2].InnerText != "" && Convert.ToDecimal(doc.SelectNodes("records").Item(0).SelectNodes("record").Item(0).ChildNodes[2 + i * 2].InnerText) != 0))
{
DataRow drnew = dtA.NewRow();
drnew["COACode"] = "62012000";
drnew["Date"] = Convert.ToDateTime(header2string.Split(',')[i * 2]);
decimal r1 = doc.SelectNodes("records").Item(0).SelectNodes("record").Item(0).ChildNodes[1 + i * 2].InnerText == "" ? 0 : Convert.ToDecimal(doc.SelectNodes("records").Item(0).SelectNodes("record").Item(0).ChildNodes[1 + i * 2].InnerText);
decimal r2 = doc.SelectNodes("records").Item(0).SelectNodes("record").Item(0).ChildNodes[2 + i * 2].InnerText == "" ? 0 : Convert.ToDecimal(doc.SelectNodes("records").Item(0).SelectNodes("record").Item(0).ChildNodes[2 + i * 2].InnerText);
drnew["Amount"] = r1 + r2;
dtA.Rows.Add(drnew);
}
//Domestic
if ((doc.SelectNodes("records").Item(0).SelectNodes("record").Item(1).ChildNodes[1 + i * 2].InnerText != "" && Convert.ToDecimal(doc.SelectNodes("records").Item(0).SelectNodes("record").Item(1).ChildNodes[1 + i * 2].InnerText) != 0) || (doc.SelectNodes("records").Item(0).SelectNodes("record").Item(1).ChildNodes[2 + i * 2].InnerText != "" && Convert.ToDecimal(doc.SelectNodes("records").Item(0).SelectNodes("record").Item(1).ChildNodes[2 + i * 2].InnerText) != 0))
{
DataRow drnew = dtA.NewRow();
drnew["COACode"] = "62012000";
drnew["Date"] = Convert.ToDateTime(header2string.Split(',')[i * 2]);
decimal r1 = doc.SelectNodes("records").Item(0).SelectNodes("record").Item(1).ChildNodes[1 + i * 2].InnerText == "" ? 0 : Convert.ToDecimal(doc.SelectNodes("records").Item(0).SelectNodes("record").Item(1).ChildNodes[1 + i * 2].InnerText);
decimal r2 = doc.SelectNodes("records").Item(0).SelectNodes("record").Item(1).ChildNodes[2 + i * 2].InnerText == "" ? 0 : Convert.ToDecimal(doc.SelectNodes("records").Item(0).SelectNodes("record").Item(1).ChildNodes[2 + i * 2].InnerText);
drnew["Amount"] = r1 + r2;
dtA.Rows.Add(drnew);
示例11: AddCol
public void AddCol(string StoreData, string header0string, string header1string, string header2string, string DSTN, string LeaveDate1, string LeaveDate2)
{
StoreSubmitDataEventArgs eSubmit = new StoreSubmitDataEventArgs(StoreData, null);
XmlNode xml = eSubmit.Xml;
XmlDocument doc = new XmlDocument();
doc.LoadXml(xml.InnerXml);
int dtcol = doc.SelectNodes("records").Item(0).SelectNodes("record").Item(0).ChildNodes.Count;
int colc = (dtcol - 3) / 2;
DataTable dt = new DataTable();
Store2.Reader[0].Fields.Add("Category", RecordFieldType.String);
dt.Columns.Add(doc.SelectNodes("records").Item(0).SelectNodes("record").Item(0).ChildNodes[0].Name, typeof(String));
for (int i = 0; i < (dtcol - 3) / 2; i++)
{
Store2.Reader[0].Fields.Add("Station_" + i.ToString() + "_P", RecordFieldType.String);
Store2.Reader[0].Fields.Add("Station_" + i.ToString() + "_C", RecordFieldType.String);
dt.Columns.Add("Station_" + i.ToString() + "_P", typeof(String));
dt.Columns.Add("Station_" + i.ToString() + "_C", typeof(String));
}
string fieldPNameNew = "Station_" + colc.ToString() + "_P";
Store2.Reader[0].Fields.Add(fieldPNameNew, RecordFieldType.String);
string fieldCNameNew = "Station_" + colc.ToString() + "_C";
Store2.Reader[0].Fields.Add(fieldCNameNew, RecordFieldType.String);
dt.Columns.Add(fieldPNameNew, typeof(String));
dt.Columns.Add(fieldCNameNew, typeof(String));
//合计列
Store2.Reader[0].Fields.Add("TotalP", RecordFieldType.String);
Store2.Reader[0].Fields.Add("TotalC", RecordFieldType.String);
dt.Columns.Add("TotalP", typeof(String));
dt.Columns.Add("TotalC", typeof(String));
//decimal row0Psum = 0, row0Csum = 0, row1Psum = 0, row1Csum = 0, row2Psum = 0, row2Csum = 0, row3Psum = 0, row3Csum = 0, row4Psum = 0, row4Csum = 0, row5Psum = 0, row5Csum = 0, row6Psum = 0, row6Csum = 0, row7Psum = 0, row7Csum = 0, row8Psum = 0, row8Csum = 0, row9Psum = 0, row9Csum = 0, row10Psum = 0, row10Csum = 0;
for (int i = 0; i < doc.SelectNodes("records").Item(0).SelectNodes("record").Count - 1; i++)
{
DataRow dr = dt.NewRow();
dt.Rows.Add(dr);
for (int j = 0; j < dtcol - 3; j++)
{
string wr = doc.SelectNodes("records").Item(0).SelectNodes("record").Item(i).ChildNodes[j].InnerText;
dt.Rows[i][j] = doc.SelectNodes("records").Item(0).SelectNodes("record").Item(i).ChildNodes[j].InnerText;
}
}
dt.Rows.Add(dt.NewRow());
dt.Rows[11][0] = "Total";
for (int i = 0; i < 11; i++)
{
for (int j = 1; j < dtcol - 3; j++)
{
if (j % 2 == 1)
{
dt.Rows[i][dtcol - 1] = (Convert.ToDecimal(dt.Rows[i][dtcol - 1].ToString() == "" ? "0" : dt.Rows[i][dtcol - 1].ToString()) + Convert.ToDecimal(dt.Rows[i][j].ToString() == "" ? "0" : dt.Rows[i][j].ToString())).ToString() == "0" ? "" : (Convert.ToDecimal(dt.Rows[i][dtcol - 1].ToString() == "" ? "0" : dt.Rows[i][dtcol - 1].ToString()) + Convert.ToDecimal(dt.Rows[i][j].ToString() == "" ? "0" : dt.Rows[i][j].ToString())).ToString();
dt.Rows[11][dtcol - 1] = (Convert.ToDecimal(dt.Rows[11][dtcol - 1].ToString() == "" ? "0" : dt.Rows[11][dtcol - 1].ToString()) + Convert.ToDecimal(dt.Rows[i][j].ToString() == "" ? "0" : dt.Rows[i][j].ToString())).ToString() == "0" ? "" : (Convert.ToDecimal(dt.Rows[11][dtcol - 1].ToString() == "" ? "0" : dt.Rows[11][dtcol - 1].ToString()) + Convert.ToDecimal(dt.Rows[i][j].ToString() == "" ? "0" : dt.Rows[i][j].ToString())).ToString();
}
else
{
dt.Rows[i][dtcol] = (Convert.ToDecimal(dt.Rows[i][dtcol].ToString() == "" ? "0" : dt.Rows[i][dtcol].ToString()) + Convert.ToDecimal(dt.Rows[i][j].ToString() == "" ? "0" : dt.Rows[i][j].ToString())).ToString() == "0" ? "" : (Convert.ToDecimal(dt.Rows[i][dtcol].ToString() == "" ? "0" : dt.Rows[i][dtcol].ToString()) + Convert.ToDecimal(dt.Rows[i][j].ToString() == "" ? "0" : dt.Rows[i][j].ToString())).ToString();
dt.Rows[11][dtcol] = (Convert.ToDecimal(dt.Rows[11][dtcol].ToString() == "" ? "0" : dt.Rows[11][dtcol].ToString()) + Convert.ToDecimal(dt.Rows[i][j].ToString() == "" ? "0" : dt.Rows[i][j].ToString())).ToString() == "0" ? "" : (Convert.ToDecimal(dt.Rows[11][dtcol].ToString() == "" ? "0" : dt.Rows[11][dtcol].ToString()) + Convert.ToDecimal(dt.Rows[i][j].ToString() == "" ? "0" : dt.Rows[i][j].ToString())).ToString();
}
dt.Rows[11][j] = (Convert.ToDecimal(dt.Rows[11][j].ToString() == "" ? "0" : dt.Rows[11][j].ToString()) + Convert.ToDecimal(dt.Rows[i][j].ToString() == "" ? "0" : dt.Rows[i][j].ToString())).ToString() == "0" ? "" : (Convert.ToDecimal(dt.Rows[11][j].ToString() == "" ? "0" : dt.Rows[11][j].ToString()) + Convert.ToDecimal(dt.Rows[i][j].ToString() == "" ? "0" : dt.Rows[i][j].ToString())).ToString();
}
}
Store2.DataSource = dt;
Store2.DataBind();
var TitleCol = new Column();
TitleCol.DataIndex = "Category";
TitleCol.Sortable = false;
TitleCol.Resizable = false;
TitleCol.MenuDisabled = true;
TitleCol.Width = 180;
this.GridPanel2.ColumnModel.Columns.Add(TitleCol);
var Title1 = new Ext.Net.Label();
Title1.Text = "Destination:";
HeaderColumn hcTitle1 = new HeaderColumn();
hcTitle1.Component.Add(Title1);
this.GridPanel2.GetView().HeaderRows[0].Columns.Add(hcTitle1);
var Title2 = new Ext.Net.Label();
Title2.Text = "Cost Center:";
HeaderColumn hcTitle2 = new HeaderColumn();
hcTitle2.Component.Add(Title2);
this.GridPanel2.GetView().HeaderRows[1].Columns.Add(hcTitle2);
var Title3 = new Ext.Net.Label();
Title3.Text = "Travel Period:";
HeaderColumn hcTitle3 = new HeaderColumn();
hcTitle3.Component.Add(Title3);
this.GridPanel2.GetView().HeaderRows[2].Columns.Add(hcTitle3);
//取得出差站点列表
DataSet GetCityInfo = DIMERCO.SDK.Utilities.LSDK.GetCityInfo("", 8000);
DataTable dtstation = GetCityInfo.Tables[0];
//取得成本中心列表
DataSet GetCCInfo = DIMERCO.SDK.Utilities.LSDK.getCostCenterBYStationCode("", 8000);
DataTable dtCC = GetCCInfo.Tables[0];
for (int i = 0; i < colc; i++)//准备复制已有信息
{
string fieldPName = "Station_" + i.ToString() + "_P";
//RecordField field1 = new RecordField(fieldAName, RecordFieldType.Float);
//.........这里部分代码省略.........
示例12: BtnSaveToExcel
protected void BtnSaveToExcel(object sender, EventArgs e)
{
string json = ExcelGridData.Value.ToString();
json = json.Replace("retailid", "单据号");
json = json.Replace("setdate", "销售日期");
json = json.Replace("znums", "数量");
json = json.Replace("zxsums", "现价金额");
json = json.Replace("zssums", "结算金额");
json = json.Replace("FCalcSums", "实销金额");
json = json.Replace("yhsum", "优惠金额");
json = json.Replace("s_sums", "实收金额");
json = json.Replace("vipcode", "VIP卡号");
json = json.Replace("s_name", "营业员");
json = json.Replace("x_name", "班组");
json = json.Replace("crdate", "制单日期");
json = json.Replace("cr_name", "制单人");
json = json.Replace("comment", "备注");
StoreSubmitDataEventArgs eSubmit = new StoreSubmitDataEventArgs(json, null);
XmlNode xml = eSubmit.Xml;
this.Response.Clear();
this.Response.ContentType = "application/vnd.ms-excel";
this.Response.AddHeader("Content-Disposition", "attachment; filename=Retail" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls");
XslCompiledTransform xtExcel = new XslCompiledTransform();
xtExcel.Load(Server.MapPath("ExcelTemp/Excel.xsl"));
xtExcel.Transform(xml, null, this.Response.OutputStream);
this.Response.End();
}
示例13: RaiseAjaxPostBackEvent
private void RaiseAjaxPostBackEvent(string eventArgument)
{
bool needConfirmation = false;
try
{
if (eventArgument.IsEmpty())
{
throw new ArgumentNullException("eventArgument");
}
XmlNode xmlData = this.SubmitConfig;
string data = null;
XmlNode parametersNode = null;
if (xmlData != null)
{
parametersNode = xmlData.SelectSingleNode("config/extraParams");
XmlNode serviceNode = xmlData.SelectSingleNode("config/serviceParams");
if (serviceNode != null)
{
data = serviceNode.InnerText;
}
}
string action = eventArgument;
BeforeDirectEventArgs e = new BeforeDirectEventArgs(action, data, parametersNode);
this.OnAjaxPostBack(e);
PageProxy dsp = this.Proxy.Proxy as PageProxy;
if (this.AutoDecode && data.IsNotEmpty())
{
data = HttpUtility.HtmlDecode(data);
}
switch(action)
{
case "update":
if (data == null)
{
throw new InvalidOperationException("No data in request");
}
needConfirmation = this.UseIdConfirmation;
this.DoSaving(data, parametersNode);
if (this.RefreshAfterSaving == RefreshAfterSavingMode.None || dsp != null)
{
needRetrieve = false;
}
break;
case "refresh":
needRetrieve = true;
StoreRefreshDataEventArgs refreshArgs = new StoreRefreshDataEventArgs(parametersNode);
this.OnRefreshData(refreshArgs);
if (dsp != null)
{
if (refreshArgs.Total > -1)
{
dsp.Total = refreshArgs.Total;
}
}
break;
case "submit":
needRetrieve = false;
if (data == null)
{
throw new InvalidOperationException("No data in request");
}
StoreSubmitDataEventArgs args =new StoreSubmitDataEventArgs(data, parametersNode);
this.OnSubmitData(args);
break;
}
}
catch (Exception ex)
{
success = false;
msg = this.IsDebugging ? ex.ToString() : ex.Message;
if (this.ResourceManager.RethrowAjaxExceptions)
{
throw;
}
}
AfterDirectEventArgs eAjaxPostBackResult = new AfterDirectEventArgs(new Response(success, msg));
this.OnAjaxPostBackResult(eAjaxPostBackResult);
StoreResponseData response = new StoreResponseData();
if (needRetrieve && eAjaxPostBackResult.Response.Success)
//.........这里部分代码省略.........
示例14: BtnSaveToExcel
protected void BtnSaveToExcel(object sender, EventArgs e)
{
string json = ExcelGridData.Value.ToString();
json = json.Replace("d_name", "店铺");
json = json.Replace("name4", "虚拟结构");
json = json.Replace("name5", "虚拟结构");
json = json.Replace("styleid", "款号");
json = json.Replace("colorid", "颜色");
json = json.Replace("s2s", "2");
json = json.Replace("s3s", "3");
json = json.Replace("s4s", "4");
json = json.Replace("s5s", "5");
json = json.Replace("s6s", "6");
json = json.Replace("total", "合计");
StoreSubmitDataEventArgs eSubmit = new StoreSubmitDataEventArgs(json, null);
XmlNode xml = eSubmit.Xml;
this.Response.Clear();
this.Response.ContentType = "application/vnd.ms-excel";
this.Response.AddHeader("Content-Disposition", "attachment; filename=Report.xls");
XslCompiledTransform xtExcel = new XslCompiledTransform();
xtExcel.Load(Server.MapPath("ExcelTemp/Excel.xsl"));
xtExcel.Transform(xml, null, this.Response.OutputStream);
this.Response.End();
}
示例15: SubmitData
//用于保存差旅费明细
protected void SubmitData(object sender, StoreSubmitDataEventArgs e)
{
DateTime dtnull = new DateTime(1, 1, 1, 0, 0, 0);
cs.DBCommand dbc = new cs.DBCommand();
//检查是否已经被该人设置过审批人
string sqlCheckFlow = "select * from GroupFlow where GID=(select GID from GroupUsers where UserID='" + cbxOwner.Text + "')";
DataTable dtCheckFlow = dbc.GetData("eReimbursement", sqlCheckFlow);
if (dtCheckFlow.Rows.Count < 1)
{
return;
}
string json = e.Json;
XmlNode xml = e.Xml;
List<Detail> Details = e.Object<Detail>();
//删除现有数据
string deletesql = "delete from ETraveleDetail where [No]='" + hdTravelRequestID.Value.ToString() + "'";
string newid1 = dbc.UpdateData("eReimbursement", deletesql, "Update");
foreach (Detail detail in Details)
{
if (newid1 == "-1")
{
ErrorHandle("Data Error.");
return;
}
//新增
string word = "[No],[Tocity],[AccountName],[AccountCode],[AccountDes],[Cur],[Pamount],[Camount],[TSation],[Createdby],[CreadedDate],[Tdate]";
string value = "";
value += "'" + hdTravelRequestID.Value.ToString() + "',";
value += "'" + detail.Tocity + "',";
value += "'" + detail.AccountName + "',";
value += "'" + detail.AccountCode + "',";
value += "'" + detail.AccountDes + "',";
value += "'" + detail.Cur + "',";
value += detail.Pamount == "" ? "null," : detail.Pamount + ",";
value += detail.Camount == "" ? "null," : detail.Camount + ",";
value += "'" + detail.TSation + "',";
value += "'" + cbxOwner.Text + "',";//edit
value += "'" + DateTime.Now.ToString() + "',";
value += detail.Tdate == "" ? "null" : "'" + detail.Tdate + "'";
string updatesql = "insert into ETraveleDetail (" + word + ") values(" + value + ");select [ID][email protected]@IDENTITY from ETraveleDetail";
string newid = dbc.UpdateData("eReimbursement", updatesql, "Insert");
if (newid == "-1")
{
ErrorHandle("Data Error."); return;
}
}
//发送提醒邮件
string sql = "select * from V_Eflow_ETravel where [Type]='T' and Step!=0 and RequestID=" + hdTravelRequestID.Value.ToString() + " order by Step,FlowID";
DataTable dtMail = new DataTable();
dtMail = dbc.GetData("eReimbursement", sql);
if (dtMail != null && dtMail.Rows.Count > 0)
{
DIMERCO.SDK.MailMsg mail = new DIMERCO.SDK.MailMsg();
mail.Title = "Dimerco eReimbursement (" + dtMail.Rows[0]["Person"].ToString() + ") - Seek For Your Approval";
mail.FromDispName = "eReimbursement";
mail.From = "[email protected]rco.com";
string mailto = "";
DataSet dsTo = DIMERCO.SDK.Utilities.LSDK.getUserProfilebyUserList(dtMail.Rows[0]["ApproverID"].ToString());
if (dsTo.Tables[0].Rows.Count == 1)
{
mailto += dsTo.Tables[0].Rows[0]["eMail"].ToString() + ",";
}
else
{
ErrorHandle("Error mail address of Approver."); return;
}
string mailcc = "";
DataSet dsCC = DIMERCO.SDK.Utilities.LSDK.getUserProfilebyUserList(dtMail.Rows[0]["PersonID"].ToString());
if (dsCC.Tables[0].Rows.Count == 1)
{
mailcc += dsCC.Tables[0].Rows[0]["eMail"].ToString() + ",";
}
else
{
ErrorHandle("Error mail address of Owner."); return;
}
if (dtMail.Rows[0]["CreadedByID"].ToString() != "" && dtMail.Rows[0]["CreadedByID"].ToString() != dtMail.Rows[0]["PersonID"].ToString())//代理人
{
dsCC = DIMERCO.SDK.Utilities.LSDK.getUserProfilebyUserList(dtMail.Rows[0]["CreadedByID"].ToString());
mailcc += dsCC.Tables[0].Rows[0]["eMail"].ToString() + ",";
}
mail.To = mailto;
mail.Cc = mailcc;
string divstyle = "style='font-size:small;'";
string divstyleCurrent = "style='font-size:small;color:blue;'";
string tdstyle = "style='border:silver 1px ridge; font-size:small;background-color: #FFFFFF'";
StringBuilder sb = new StringBuilder();
sb.Append("<div>");
sb.Append("<div " + divstyle + "> Dear " + dtMail.Rows[0]["Approver"].ToString() + ",</div><br />");
sb.Append("<div " + divstyle + ">The following eReimbursement application for your approval:</div><br /><br />");
sb.Append("<div " + divstyle + ">eReimbursement Approval Remarks :</div><br />");
sb.Append("<div " + divstyle + ">Owner:" + dtMail.Rows[0]["Person"].ToString() + "</div>");
sb.Append("<div " + divstyle + ">Station:" + dtMail.Rows[0]["Station"].ToString() + "</div>");
sb.Append("<div " + divstyle + ">Department:" + dtMail.Rows[0]["Department"].ToString() + "</div>");
//.........这里部分代码省略.........