protected void init() { string ID = Request.Form["BuyReceiptID"].ToString(); List <VBuyPay> list = new List <VBuyPay>(); list = Leyp.SQLServerDAL.Buy.Factory.getBuyPayDAL().getByBuyReceiptID(ID); float tatal = float.Parse("0.00"); StringBuilder sb = new StringBuilder(); sb.Append("<table class=\"flexme2\"><thead><tr><th width=\"100\">票 号</th><th width=\"100\">制单日期</th><th width=\"90\">制 单 人</th><th width=\"80\">付款方式 </th><th width=\"100\">实付金额</th><th width=\"120\">附加支出金额 </th><th width=\"70\">状态</th><th width=\"150\">摘要 </th></tr>"); sb.Append(" </thead><tbody>"); for (int i = 0; i < list.Count; i++) { VBuyPay v = new VBuyPay(); v = list[i]; sb.Append("<tr>"); sb.Append(" <td>" + v.Ticket + "</td>"); sb.Append(" <td>" + v.CreateDate + "</td>"); sb.Append(" <td>" + v.RealName + "</td>"); sb.Append(" <td>" + v.PayType + "</td>"); sb.Append(" <td>" + v.RealPay.ToString() + "</td>"); sb.Append(" <td>" + v.AttachPay.ToString() + "</td>"); sb.Append(" <td>" + changString(v.State.ToString()) + "</td>"); sb.Append(" <td>" + v.Description.ToString() + "</td>"); sb.Append("</tr>"); } sb.Append("</tbody></table>"); Response.Write(sb.ToString()); Response.End(); }
public VBuyPay getViewNodeByID(int PayID) { string s = ""; VBuyPay pay = new VBuyPay(); SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@PayID", SqlDbType.NVarChar) }; parameters[0].Value = PayID; SqlDataReader reader = SQLHelper.RunProcedure("p_BuyPay_getViewNodeByID", parameters); if (reader.Read()) { s = reader.GetValue(reader.GetOrdinal("RealPay")).ToString(); pay.RealPay = float.Parse(s); s = reader.GetValue(reader.GetOrdinal("AttachPay")).ToString(); pay.AttachPay = float.Parse(s); pay.PayID = reader.GetInt32(reader.GetOrdinal("PayID")); pay.AuditingUser = reader.GetString(reader.GetOrdinal("AuditingUser")); pay.BuyReceiptID = reader.GetString(reader.GetOrdinal("BuyReceiptID")); pay.CreateDate = reader.GetString(reader.GetOrdinal("CreateDate")); pay.RealName = reader.GetString(reader.GetOrdinal("RealName")); pay.PayType = reader.GetString(reader.GetOrdinal("PayType")); pay.Ticket = reader.GetString(reader.GetOrdinal("Ticket")); pay.State = reader.GetInt32(reader.GetOrdinal("State")); pay.UserName = reader.GetString(reader.GetOrdinal("UserName")); } reader.Close(); return(pay); }
public List <VBuyPay> getBuyPayOrderList(string beginDate, string endDate, int sideState) { string s = ""; List <VBuyPay> list = new List <VBuyPay>(); SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@beginDate", SqlDbType.NVarChar), new SqlParameter("@endDate", SqlDbType.NVarChar), new SqlParameter("@sideState", SqlDbType.Int) }; parameters[0].Value = beginDate; parameters[1].Value = endDate; parameters[2].Value = sideState; SqlDataReader reader = SQLHelper.RunProcedure("p_BuyPay_getBuyPayOrderList", parameters); while (reader.Read()) { VBuyPay item = new VBuyPay(); s = reader.GetValue(reader.GetOrdinal("RealPay")).ToString(); item.RealPay = float.Parse(s); s = reader.GetValue(reader.GetOrdinal("AttachPay")).ToString(); item.AttachPay = float.Parse(s); item.PayID = reader.GetInt32(reader.GetOrdinal("PayID")); item.AuditingUser = reader.GetString(reader.GetOrdinal("AuditingUser")); item.BuyReceiptID = reader.GetString(reader.GetOrdinal("BuyReceiptID")); item.CreateDate = reader.GetString(reader.GetOrdinal("CreateDate")); item.RealName = reader.GetString(reader.GetOrdinal("RealName")); item.PayType = reader.GetString(reader.GetOrdinal("PayType")); item.Ticket = reader.GetString(reader.GetOrdinal("Ticket")); item.State = reader.GetInt32(reader.GetOrdinal("State")); item.UserName = reader.GetString(reader.GetOrdinal("UserName")); list.Add(item); } reader.Close(); return(list); }
public List <VBuyPay> getByBuyReceiptID(string BuyReceiptID) { string s = ""; List <VBuyPay> list = new List <VBuyPay>(); SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@BuyReceiptID", SqlDbType.NVarChar) }; parameters[0].Value = BuyReceiptID; SqlDataReader reader = SQLHelper.RunProcedure("p_BuyPay_getByBuyReceiptID", parameters); while (reader.Read()) { VBuyPay item = new VBuyPay(); s = reader.GetValue(reader.GetOrdinal("RealPay")).ToString(); item.RealPay = float.Parse(s); s = reader.GetValue(reader.GetOrdinal("AttachPay")).ToString(); item.AttachPay = float.Parse(s); item.PayID = reader.GetInt32(reader.GetOrdinal("PayID")); item.AuditingUser = reader.GetString(reader.GetOrdinal("AuditingUser")); item.BuyReceiptID = reader.GetString(reader.GetOrdinal("BuyReceiptID")); item.CreateDate = reader.GetString(reader.GetOrdinal("CreateDate")); item.RealName = reader.GetString(reader.GetOrdinal("RealName")); item.PayType = reader.GetString(reader.GetOrdinal("PayType")); item.Ticket = reader.GetString(reader.GetOrdinal("Ticket")); item.State = reader.GetInt32(reader.GetOrdinal("State")); item.UserName = reader.GetString(reader.GetOrdinal("UserName")); item.Description = reader.GetString(reader.GetOrdinal("Description")); list.Add(item); } reader.Close(); return(list); }
public void init() { object action = Request.QueryString["action"].ToString(); if (action == null) { } else if (action.ToString().Equals("BuyPayLoad"))///在添加采购付款是使用 { string str0 = Request.QueryString["BuyReceiptID"].ToString(); float Total = float.Parse("0.00"); List <VBuyPay> list = new List <VBuyPay>(); BuyReceipt vb = new BuyReceipt(); vb = Leyp.SQLServerDAL.Buy.Factory.getBuyReceiptDAL().getByID(str0); list = Leyp.SQLServerDAL.Buy.Factory.getBuyPayDAL().getByBuyReceiptID(str0); for (int i = 0; i < list.Count; i++) { VBuyPay b = list[i]; Total = Total + b.RealPay; } Response.Write(vb.TotalPrice + "$$$" + Total.ToString()); Response.End(); } else if (action.ToString().Equals("BuyPayLoadAdd"))//添加一个采购单 { string str0 = Request.QueryString["BuyReceiptID"].ToString(); string str1 = Request.QueryString["Ticket"].ToString(); string str2 = Request.QueryString["CreateDate"].ToString(); string str3 = Request.QueryString["PayType"].ToString(); string str4 = Request.QueryString["RealPay"].ToString(); string str5 = Request.QueryString["AttachPay"].ToString(); string str6 = Request.QueryString["Description"].ToString(); BuyPay b = new BuyPay(); b.BuyReceiptID = str0; b.Ticket = str1; b.CreateDate = str2; b.PayType = str3; b.RealPay = float.Parse(str4); b.AttachPay = float.Parse(str5); b.Description = str6; b.UserName = "******"; Leyp.SQLServerDAL.Buy.Factory.getBuyPayDAL().insertNewEntity(b); Response.Write("添加成功"); Response.End(); } }