public MFooterDiscountPayTypeDetails ModifyMFooterDiscountPayTypeDetailsByID(int ID) { SqlConnection Con = new SqlConnection(CommonFunctions.ConStr); string sql; SqlCommand cmd; sql = "Select * from MFooterDiscountPayTypeDetails where PkSrNo =" + ID; cmd = new SqlCommand(sql, Con); cmd.Connection = Con; Con.Open(); cmd.CommandType = CommandType.Text; SqlDataReader dr; dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); if (dr.HasRows) { MFooterDiscountPayTypeDetails MM = new MFooterDiscountPayTypeDetails(); while (dr.Read()) { MM.PkSrNo = Convert.ToInt32(dr["PkSrNo"]); if (!Convert.IsDBNull(dr["FooterDiscNo"])) { MM.FooterDiscNo = Convert.ToInt64(dr["FooterDiscNo"]); } if (!Convert.IsDBNull(dr["PayTypeNo"])) { MM.PayTypeNo = Convert.ToInt64(dr["PayTypeNo"]); } if (!Convert.IsDBNull(dr["IsActive"])) { MM.IsActive = Convert.ToBoolean(dr["IsActive"]); } if (!Convert.IsDBNull(dr["CompanyNo"])) { MM.CompanyNo = Convert.ToInt64(dr["CompanyNo"]); } } dr.Close(); return(MM); } else { dr.Close(); } return(new MFooterDiscountPayTypeDetails()); }
public bool DeleteMFooterDiscountPayTypeDetails(MFooterDiscountPayTypeDetails mfooterdiscountpaytypedetails) { SqlCommand cmd; cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "DeleteMFooterDiscountPayTypeDetails"; cmd.Parameters.AddWithValue("@PkSrNo", mfooterdiscountpaytypedetails.PkSrNo); if (ObjTrans.ExecuteNonQuery(cmd, CommonFunctions.ConStr) == true) { return(true); } else { mfooterdiscountpaytypedetails.msg = ObjTrans.ErrorMessage; return(false); } }
public bool AddMFooterDiscountPayTypeDetails(MFooterDiscountPayTypeDetails mfooterdiscountpaytypedetails) { SqlCommand cmd; cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "AddMFooterDiscountPayTypeDetails"; cmd.Parameters.AddWithValue("@PkSrNo", mfooterdiscountpaytypedetails.PkSrNo); // cmd.Parameters.AddWithValue("@FooterDiscNo", mfooterdiscountpaytypedetails.FooterDiscNo); cmd.Parameters.AddWithValue("@PayTypeNo", mfooterdiscountpaytypedetails.PayTypeNo); cmd.Parameters.AddWithValue("@IsActive", mfooterdiscountpaytypedetails.IsActive); cmd.Parameters.AddWithValue("@CompanyNo", mfooterdiscountpaytypedetails.CompanyNo); commandcollection.Add(cmd); return(true); }