Exemple #1
0
        public bool UpdateQuotation(T_quotation qt)
        {
            try
            {
                ph = new ProductHelper();
                return ph.UpdateQuotation(qt);
            }
            catch (Exception)
            {

                throw;
            }
        }
Exemple #2
0
        public bool AddNewQtAndQtprice(T_quotation newqt, List<QtProduct> qtpricelst)
        {
            try
            {
                ph = new ProductHelper();
                ph.AddNewQuotation(newqt);
                foreach (var qp in qtpricelst)
                {
                    qp.qp.quotationid = newqt.id;
                }
                return ph.AddNewQtPriceList(qtpricelst);
            }
            catch (Exception)
            {

                throw;
            }
        }
Exemple #3
0
        /// <summary>
        /// 添加新报价单
        /// </summary>
        /// <param name="newqt"></param>
        /// <returns></returns>
        public bool AddNewQuotation(T_quotation newqt)
        {
            try
            {
                ph = new ProductHelper();
                return ph.AddNewQuotation(newqt);
            }
            catch (Exception)
            {

                throw;
            }
        }
Exemple #4
0
 /// <summary>
 /// 添加新的报价单
 /// </summary>
 /// <param name="newqt"></param>
 /// <returns></returns>
 public bool AddNewQuotation(T_quotation newqt)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(newqt).State = EntityState.Added;
         return db.SaveChanges() > 0 ? true : false;
     }
 }
Exemple #5
0
 /// <summary>
 /// 修改报价单
 /// </summary>
 /// <param name="qt"></param>
 /// <returns></returns>
 public bool UpdateQuotation(T_quotation qt)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(qt).State = EntityState.Modified;
         return db.SaveChanges() > 0 ? true : false;
     }
 }
Exemple #6
0
        protected override void FormLoad()
        {
            gcQtprice.DataSource = m_QtProductlst;
            barbtn1.Visibility = BarItemVisibility.Always;
            barbtn1.LargeImageIndex = 9;
            barbtn1.Caption = "添加产品";
            txtQtPrice.Properties.ReadOnly = true;
            txtCustomer.Properties.ReadOnly = true;

            if (formmode == frmmodetype.add)
            {
                m_Qinfo = new T_quotation();
            }
            else if (formmode==frmmodetype.edit)
            {
                m_Qinfo = m_crmclient.getQuotationbyId(m_qid);
                SetData(m_Qinfo);
                m_QtProductlst = m_crmclient.getQtProduct(m_qid);
                gcQtprice.DataSource = m_QtProductlst;
                barbtn1.Enabled = false;
            }
            else if (formmode == frmmodetype.delete)
            {
                m_Qinfo = m_crmclient.getQuotationbyId(m_qid);
                SetData(m_Qinfo);
                base.readonlytxtbox(this.Controls, true);
                m_QtProductlst = m_crmclient.getQtProduct(m_qid);
                gcQtprice.DataSource = m_QtProductlst;
                barbtn1.Enabled = false;
            }
            base.FormLoad();
        }
Exemple #7
0
 /// <summary>
 /// 设置实体属性至窗体控件
 /// </summary>
 /// <param name="qinfo"></param>
 private void SetData(T_quotation qinfo)
 {
     txtQuno.Text = qinfo.qutationno;
     txtQtPrice.Text = qinfo.quotationprice.HasValue ? qinfo.quotationprice.Value.ToString() : "";
     txtProductRemark.Text = qinfo.productremark;
     txtQuremark.Text = qinfo.quremark;
     txtTheme.Text = qinfo.theme;
     dateQu.DateTime = qinfo.quotationdate.Value;
     if (qinfo.customerid.HasValue)
     {
         txtCustomer.Text = m_crmclient.getCustomerbyid(qinfo.customerid.Value).customername;
     }
 }
Exemple #8
0
 private void GetData(T_quotation qinfo)
 {
     qinfo.qutationno = txtQuno.Text;
     qinfo.theme = txtTheme.Text;
     qinfo.quotationprice = txtQtPrice.Text == "" ? 0 : Convert.ToDecimal(txtQtPrice.Text);
     qinfo.productremark = txtProductRemark.Text;
     qinfo.quremark = txtQuremark.Text;
     if (dateQu.Text == "")
     {
         qinfo.quotationdate = null;
     }
     else
     {
         qinfo.quotationdate = dateQu.DateTime;
     }
 }