CeramicProject/newyt/Common/wxfk_dy.aspx.cs

74 lines
2.6 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Ajax;
public partial class Common_wxfk_dy : System.Web.UI.Page
{
public string userinfo = "";
protected void Page_Load(object sender, EventArgs e)
{
DataTable dtuserinfo = DBHlper.Execute("select mingcheng,logourl from nr_sysuserinfo").Tables[0];
if (dtuserinfo.Rows.Count > 0)
{
userinfo = dtuserinfo.Rows[0]["mingcheng"].ToString();
img_logo.Src = "../UseFile/" + dtuserinfo.Rows[0]["logourl"].ToString();
}
else
{
img_logo.Visible = false;
}
Utility.RegisterTypeForAjax(typeof(Common_wxfk_dy));
dyrq.Text = DateTime.Now.ToString("yyyy-MM-dd");
}
[Ajax.AjaxMethod]
public string[] getxinxi(int[] zu)
{
string[] code = new string[2];
string code1 = "";
string khname = "";
try
{
foreach (int i in zu)
{
DataSet ds = DBHlper.Execute("select *,(SELECT ISNULL(SUM(wxfyze), 0) FROM dbo.view_nr_z_ddwxd WHERE (wxdh=view_nr_z_wxfk.wxdh)) as zje from view_nr_z_wxfk where id='" + i + "' order by id ");
if (ds != null && ds.Tables[0].Rows.Count > 0)
{
//如果当前订单下存在明细就加载成tr行
foreach (DataRow r in ds.Tables[0].Rows)
{
khname = r["mingcheng"].ToString();
code1 += "<tr>"
+ " <td class='head4'>" + r["wxdh"].ToString() + "</td>"
//+ "<td class='head4'>" + r["gdh"].ToString() + "</td>"
+ "</td><td class='head4'>" + r["zje"].ToString() + "</td>"
+ "</td><td class='head4 je'>" + r["fkje"].ToString() + "</td>"
+ "</td><td class='head4'>" + r["fkfs"].ToString() + "</td>"
+ "</td><td class='head4'>" + r["fpje"].ToString() + "</td>"
+ "</td><td class='head4'>" + Convert.ToDateTime(r["fkrq"]).ToString("yyyy-MM-dd") + "</td>"
+ "</td><td class='head4'>" + r["bz"].ToString() + "</td></tr>";
}
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
code[0] = code1;
code[1] = khname;
return code;
}
[Ajax.AjaxMethod]
public string hsdx(string zje)
{
return DBHlper.ConvertToChineseNum(zje);
}
}