public static int UpdateTbl_ProjectBuyContractPay(Tbl_ProjectBuyContractPay tbl_projectbuycontractpay) { WebCommon.Public.WriteLog("修改收费:" + tbl_projectbuycontractpay.ProjectBuyContractID); tbl_projectbuycontractpay.DealUser = WebCommon.Public.GetUserName(); tbl_projectbuycontractpay.DealTime = DateTime.Now; return(new Tbl_ProjectBuyContractPayService().UpdateTbl_ProjectBuyContractPayById(tbl_projectbuycontractpay)); }
/// <summary> ///根据SQL语句获取集合 /// </summary> private IList <Tbl_ProjectBuyContractPay> getTbl_ProjectBuyContractPaysBySql(string sql) { IList <Tbl_ProjectBuyContractPay> list = new List <Tbl_ProjectBuyContractPay>(); DataSet ds = DBHelper.ExecuteDataset(this.connection, CommandType.Text, sql); if (ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { Tbl_ProjectBuyContractPay tbl_projectbuycontractpay = new Tbl_ProjectBuyContractPay(); tbl_projectbuycontractpay.ID = Convert.ToInt32(dr["ID"]); tbl_projectbuycontractpay.ProjectBuyContractID = Convert.ToInt32(dr["ProjectBuyContractID"]); tbl_projectbuycontractpay.PayNum = Convert.ToInt32(dr["PayNum"]); tbl_projectbuycontractpay.PayMoney = Convert.ToDouble(dr["PayMoney"]); tbl_projectbuycontractpay.PayPrice = Convert.ToDouble(dr["PayPrice"]); tbl_projectbuycontractpay.Status = Convert.ToString(dr["Status"]); tbl_projectbuycontractpay.AddDate = Convert.ToDateTime(dr["AddDate"]); tbl_projectbuycontractpay.DealFlag = Convert.ToInt32(dr["DealFlag"]); tbl_projectbuycontractpay.DealUser = Convert.ToString(dr["DealUser"]); tbl_projectbuycontractpay.DealTime = Convert.ToDateTime(dr["DealTime"]); list.Add(tbl_projectbuycontractpay); } } return(list); }
public int AddTbl_ProjectBuyContractPay(Tbl_ProjectBuyContractPay tbl_projectbuycontractpay) { string sql = "insert into [Tbl_ProjectBuyContractPay] ([ProjectBuyContractID],[PayNum],[PayMoney],[PayPrice],[Status],[DealUser]) values (@ProjectBuyContractID,@PayNum,@PayMoney,@PayPrice,@Status,[DealUser])"; SqlParameter[] sp = new SqlParameter[] { new SqlParameter("@ProjectBuyContractID", tbl_projectbuycontractpay.ProjectBuyContractID), new SqlParameter("@PayNum", tbl_projectbuycontractpay.PayNum), new SqlParameter("@PayMoney", tbl_projectbuycontractpay.PayMoney), new SqlParameter("@PayPrice", tbl_projectbuycontractpay.PayPrice), new SqlParameter("@Status", tbl_projectbuycontractpay.Status), new SqlParameter("@DealUser", tbl_projectbuycontractpay.DealUser) }; return(DBHelper.ExecuteNonQuery(this.connection, CommandType.Text, sql, sp)); }
public int UpdateTbl_ProjectBuyContractPayById(Tbl_ProjectBuyContractPay tbl_projectbuycontractpay) { string sql = "update [Tbl_ProjectBuyContractPay] set [ProjectBuyContractID]=@ProjectBuyContractID,[PayNum]=@PayNum,[PayMoney]=@PayMoney,[PayPrice]=@PayPrice,[Status]=@Status,[DealUser]=@DealUser where DealFlag=0 and [ID]=@ID"; SqlParameter[] sp = new SqlParameter[] { new SqlParameter("@ID", tbl_projectbuycontractpay.ID), new SqlParameter("@ProjectBuyContractID", tbl_projectbuycontractpay.ProjectBuyContractID), new SqlParameter("@PayNum", tbl_projectbuycontractpay.PayNum), new SqlParameter("@PayMoney", tbl_projectbuycontractpay.PayMoney), new SqlParameter("@PayPrice", tbl_projectbuycontractpay.PayPrice), new SqlParameter("@Status", tbl_projectbuycontractpay.Status), new SqlParameter("@DealUser", tbl_projectbuycontractpay.DealUser) }; return(DBHelper.ExecuteNonQuery(this.connection, CommandType.Text, sql, sp)); }
public static int AddTbl_ProjectBuyContractPay(Tbl_ProjectBuyContractPay tbl_projectbuycontractpay) { WebCommon.Public.WriteLog("添加收费:" + tbl_projectbuycontractpay.ProjectBuyContractID); return(new Tbl_ProjectBuyContractPayService().AddTbl_ProjectBuyContractPay(tbl_projectbuycontractpay)); }