Esempio n. 1
0
        public bool AddTQuotationDetails1(TQuotationDetails tquotationdetails)
        {
            SqlCommand cmd;

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

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

            cmd.Parameters.AddWithValue("@FkQuotationNo", tquotationdetails.FkQuotationNo);

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

            cmd.Parameters.AddWithValue("@ItemNo", tquotationdetails.ItemNo);

            cmd.Parameters.AddWithValue("@MRP", tquotationdetails.MRP);

            cmd.Parameters.AddWithValue("@Rate", tquotationdetails.Rate);

            cmd.Parameters.AddWithValue("@FkRateSettingNo", tquotationdetails.FkRateSettingNo);

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

            cmd.Parameters.AddWithValue("@StatusNo", tquotationdetails.StatusNo);

            cmd.Parameters.AddWithValue("@IsClose", tquotationdetails.IsClose);

            commandcollection.Add(cmd);
            return(true);
        }
Esempio n. 2
0
        public bool DeleteTQuotationDetails1(TQuotationDetails tquotationdetails)
        {
            SqlCommand cmd;

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

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

            commandcollection.Add(cmd);
            return(true);
        }
Esempio n. 3
0
        public TQuotationDetails ModifyTQuotationDetailsByID(long ID)
        {
            SqlConnection Con = new SqlConnection(CommonFunctions.ConStr);
            string        sql;
            SqlCommand    cmd;

            sql            = "Select * from TQuotationDetails 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)
            {
                TQuotationDetails MM = new TQuotationDetails();
                while (dr.Read())
                {
                    MM.PkSrNo = Convert.ToInt32(dr["PkSrNo"]);
                    if (!Convert.IsDBNull(dr["FkQuotationNo"]))
                    {
                        MM.FkQuotationNo = Convert.ToInt64(dr["FkQuotationNo"]);
                    }
                    if (!Convert.IsDBNull(dr["LedgerNo"]))
                    {
                        MM.LedgerNo = Convert.ToInt64(dr["LedgerNo"]);
                    }
                    if (!Convert.IsDBNull(dr["ItemNo"]))
                    {
                        MM.ItemNo = Convert.ToInt64(dr["ItemNo"]);
                    }
                    if (!Convert.IsDBNull(dr["MRP"]))
                    {
                        MM.MRP = Convert.ToDouble(dr["MRP"]);
                    }
                    if (!Convert.IsDBNull(dr["Rate"]))
                    {
                        MM.Rate = Convert.ToDouble(dr["Rate"]);
                    }
                    if (!Convert.IsDBNull(dr["FkRateSettingNo"]))
                    {
                        MM.FkRateSettingNo = Convert.ToInt64(dr["FkRateSettingNo"]);
                    }
                    if (!Convert.IsDBNull(dr["CompanyNo"]))
                    {
                        MM.CompanyNo = Convert.ToInt64(dr["CompanyNo"]);
                    }
                    if (!Convert.IsDBNull(dr["StatusNo"]))
                    {
                        MM.StatusNo = Convert.ToInt64(dr["StatusNo"]);
                    }
                    if (!Convert.IsDBNull(dr["IsClose"]))
                    {
                        MM.IsClose = Convert.ToBoolean(dr["IsClose"]);
                    }
                }
                dr.Close();
                return(MM);
            }
            else
            {
                dr.Close();
            }
            return(new TQuotationDetails());
        }