Example #1
0
        public bool DeleteTChequeNo(TChequeNo tchequeno)
        {
            SqlCommand cmd;

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

            cmd.Parameters.AddWithValue("@PkChequeNo", tchequeno.PkChequeNo);
            if (ObjTrans.ExecuteNonQuery(cmd, CommonFunctions.ConStr) == true)
            {
                return(true);
            }
            else
            {
                tchequeno.msg = ObjTrans.ErrorMessage;
                return(false);
            }
        }
Example #2
0
        public bool AddTChequeNo(TChequeNo tchequeno)
        {
            SqlCommand cmd;

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

            cmd.Parameters.AddWithValue("@PkChequeNo", tchequeno.PkChequeNo);

            cmd.Parameters.AddWithValue("@ChequeUserNo", tchequeno.ChequeUserNo);

            cmd.Parameters.AddWithValue("@LedgerNo", tchequeno.LedgerNo);

            cmd.Parameters.AddWithValue("@FromChequeNo", tchequeno.FromChequeNo);

            cmd.Parameters.AddWithValue("@ToChequeNo", tchequeno.ToChequeNo);

            cmd.Parameters.AddWithValue("@Remark", tchequeno.Remark);

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

            cmd.Parameters.AddWithValue("@UserId", tchequeno.UserId);

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

            SqlParameter outParameter = new SqlParameter();

            outParameter.ParameterName = "@ReturnID";
            outParameter.Direction     = ParameterDirection.Output;
            outParameter.DbType        = DbType.Int32;
            cmd.Parameters.Add(outParameter);

            commandcollection.Add(cmd);
            return(true);
        }
Example #3
0
        public TChequeNo ModifyTChequeNoByID(long ID)
        {
            SqlConnection Con = new SqlConnection(CommonFunctions.ConStr);
            string        sql;
            SqlCommand    cmd;

            sql            = "Select * from TChequeNo where PkChequeNo =" + 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)
            {
                TChequeNo MM = new TChequeNo();
                while (dr.Read())
                {
                    MM.PkChequeNo = Convert.ToInt32(dr["PkChequeNo"]);
                    if (!Convert.IsDBNull(dr["ChequeUserNo"]))
                    {
                        MM.ChequeUserNo = Convert.ToInt64(dr["ChequeUserNo"]);
                    }
                    if (!Convert.IsDBNull(dr["LedgerNo"]))
                    {
                        MM.LedgerNo = Convert.ToInt64(dr["LedgerNo"]);
                    }
                    if (!Convert.IsDBNull(dr["FromChequeNo"]))
                    {
                        MM.FromChequeNo = Convert.ToInt64(dr["FromChequeNo"]);
                    }
                    if (!Convert.IsDBNull(dr["ToChequeNo"]))
                    {
                        MM.ToChequeNo = Convert.ToInt64(dr["ToChequeNo"]);
                    }
                    if (!Convert.IsDBNull(dr["Remark"]))
                    {
                        MM.Remark = Convert.ToString(dr["Remark"]);
                    }
                    if (!Convert.IsDBNull(dr["IsActive"]))
                    {
                        MM.IsActive = Convert.ToBoolean(dr["IsActive"]);
                    }
                    if (!Convert.IsDBNull(dr["UserId"]))
                    {
                        MM.UserId = Convert.ToInt64(dr["UserId"]);
                    }
                    if (!Convert.IsDBNull(dr["UserDate"]))
                    {
                        MM.UserDate = Convert.ToDateTime(dr["UserDate"]);
                    }
                    if (!Convert.IsDBNull(dr["ModifiedBy"]))
                    {
                        MM.ModifiedBy = Convert.ToString(dr["ModifiedBy"]);
                    }
                }
                dr.Close();
                return(MM);
            }
            else
            {
                dr.Close();
            }
            return(new TChequeNo());
        }