Example #1
0
        public MFirmBank ModifyMFirmBankByID(long ID)
        {
            SqlConnection Con = new SqlConnection(CommonFunctions.ConStr);
            string        sql;
            SqlCommand    cmd;

            sql            = "Select * from MFirmBank where FirmNo =" + 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)
            {
                MFirmBank MM = new MFirmBank();
                while (dr.Read())
                {
                    MM.PkSrNo = Convert.ToInt32(dr["PkSrNo"]);
                    if (!Convert.IsDBNull(dr["IsActive"]))
                    {
                        MM.IsActive = Convert.ToBoolean(dr["IsActive"]);
                    }
                }
                dr.Close();
                return(MM);
            }
            else
            {
                dr.Close();
            }
            return(new MFirmBank());
        }
Example #2
0
        public bool DeleteMFirmBank(MFirmBank mFirmBank)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "DeleteMManufacturerBank";

            cmd.Parameters.AddWithValue("@PkSrNo", mFirmBank.PkSrNo);

            commandcollection.Add(cmd);
            return(true);
        }
Example #3
0
        public bool AddMFirmBank(MFirmBank mFirmBank)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddMFirmBank";

            cmd.Parameters.AddWithValue("@PkSrNo", mFirmBank.PkSrNo);

            cmd.Parameters.AddWithValue("@BankNo", mFirmBank.BankNo);

            cmd.Parameters.AddWithValue("@UserID", mFirmBank.UserID);

            cmd.Parameters.AddWithValue("@IsActive", mFirmBank.IsActive);

            cmd.Parameters.AddWithValue("@UserDate", mFirmBank.UserDate);

            commandcollection.Add(cmd);
            return(true);
        }