Пример #1
0
        public bool DeleteTDocketPrinting(TDocketPrinting tdocketprinting)
        {
            SqlCommand cmd;

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

            cmd.Parameters.AddWithValue("@DocketPrintingNo", tdocketprinting.DocketPrintingNo);

            if (ObjTrans.ExecuteNonQuery(cmd, CommonFunctions.ConStr) == true)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #2
0
        public bool AddTDocketPrinting(TDocketPrinting tdocketprinting)
        {
            SqlCommand cmd;

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

            cmd.Parameters.AddWithValue("@DocketPrintingNo", tdocketprinting.DocketPrintingNo);

            cmd.Parameters.AddWithValue("@DocketUserNo", tdocketprinting.DocketUserNo);

            cmd.Parameters.AddWithValue("@FromDate", tdocketprinting.FromDate);

            cmd.Parameters.AddWithValue("@ToDate", tdocketprinting.ToDate);

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

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

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

            cmd.Parameters.AddWithValue("@CompanyNo", tdocketprinting.CompanyNo);


            SqlParameter outParameter = new SqlParameter();

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

            commandcollection.Add(cmd);

            return(true);
        }
Пример #3
0
        public TDocketPrinting ModifyTDocketPrintingByID(long ID)
        {
            SqlConnection Con = new SqlConnection(CommonFunctions.ConStr);
            string        sql;
            SqlCommand    cmd;

            sql            = "Select * from TDocketPrinting where DocketPrintingNo =" + 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)
            {
                TDocketPrinting MM = new TDocketPrinting();
                while (dr.Read())
                {
                    MM.DocketPrintingNo = Convert.ToInt32(dr["DocketPrintingNo"]);
                    if (!Convert.IsDBNull(dr["DocketUserNo"]))
                    {
                        MM.DocketUserNo = Convert.ToInt64(dr["DocketUserNo"]);
                    }
                    if (!Convert.IsDBNull(dr["FromDate"]))
                    {
                        MM.FromDate = Convert.ToDateTime(dr["FromDate"]);
                    }
                    if (!Convert.IsDBNull(dr["ToDate"]))
                    {
                        MM.ToDate = Convert.ToDateTime(dr["ToDate"]);
                    }
                    if (!Convert.IsDBNull(dr["LedgerNo"]))
                    {
                        MM.LedgerNo = Convert.ToInt64(dr["LedgerNo"]);
                    }
                    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["CompanyNo"]))
                    {
                        MM.CompanyNo = Convert.ToInt64(dr["CompanyNo"]);
                    }
                    if (!Convert.IsDBNull(dr["Status"]))
                    {
                        MM.Status = Convert.ToInt64(dr["Status"]);
                    }
                }
                dr.Close();
                return(MM);
            }
            else
            {
                dr.Close();
            }
            return(new TDocketPrinting());
        }