public bool insertNewEntity(AppendStock s) { int rowsAffected = 0; SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@AppendID", SqlDbType.NVarChar), new SqlParameter("@AppendType", SqlDbType.Int), new SqlParameter("@StoreHouseID", SqlDbType.Int), new SqlParameter("@HouseDetailID", SqlDbType.Int), new SqlParameter("@UserName", SqlDbType.NVarChar), new SqlParameter("@TradeDate", SqlDbType.NVarChar), new SqlParameter("@TotalPrice", SqlDbType.Float), new SqlParameter("@AlreadyPay", SqlDbType.Float), new SqlParameter("@Description", SqlDbType.NVarChar), new SqlParameter("@State", SqlDbType.Int), new SqlParameter("@CreateDate", SqlDbType.NVarChar) }; parameters[0].Value = s.AppendID; parameters[1].Value = s.AppendType; parameters[2].Value = s.StoreHouseID; parameters[3].Value = s.HouseDetailID; parameters[4].Value = s.UserName; parameters[5].Value = s.TradeDate; parameters[6].Value = s.TotalPrice; parameters[7].Value = s.AlreadyPay; parameters[8].Value = s.Description; parameters[9].Value = s.State; parameters[10].Value = s.CreateDate; SQLHelper.RunProcedure("p_AppendStock_insertNewEntity", parameters, out rowsAffected); return(1 == rowsAffected); }
protected void init() { string action = Request.QueryString["action"].ToString(); if (action.Equals("add")) { string str0 = Request.QueryString["AppendID"].ToString(); string str1 = Request.QueryString["CreateDate"].ToString(); string str2 = Request.QueryString["StoreHouseID"].ToString(); string str3 = Request.QueryString["HouseDetailID"].ToString(); string str4 = Request.QueryString["AppendType"].ToString(); string str5 = Request.QueryString["AlreadyPay"].ToString(); string str6 = Request.QueryString["TradeDate"].ToString(); string str7 = Request.QueryString["Description"].ToString(); AppendStock a = new AppendStock(); a.AlreadyPay = float.Parse(str5); a.AppendID = str0; a.AppendType = int.Parse(str4); a.CreateDate = str1; a.Description = str7; a.HouseDetailID = int.Parse(str3); a.StoreHouseID = int.Parse(str2); a.TradeDate = str6; a.UserName = getUserName(); Leyp.SQLServerDAL.Stock.Factory.getAppendStockDAL().insertNewEntity(a); Response.Write("0"); Response.End(); } else if (action.Equals("delete")) { string str0 = Request.QueryString["AppendID"].ToString(); Leyp.SQLServerDAL.Stock.Factory.getAppendStockDAL().deleteEitity(str0); Response.Write("成功删除单据" + str0); Response.End(); } }