Exemple #1
0
 private void SaveSelectedProperty(Model.QuotationDetail quotationDetail)
 {
     if (AddtoGrid != null)
     {
         AddtoGrid(quotationDetail);
     }
 }
 public frmSelectProperty()
 {
     InitializeComponent();
     Dock              = DockStyle.Fill;
     lblNotify1.Text   = "";
     m_QuotationDetail = new Model.QuotationDetail();
     FormUtility.FormatForm(this);
 }
 public frmEditProductProperties(Model.QuotationDetail quotationDetail, Model.Product product, Model.Company company)
 {
     InitializeComponent();
     m_QuotationDetail = quotationDetail;
     m_Product         = product;
     m_Company         = company;
     FormUtility.FormatForm(this);
     lblNotify1.Text = "";
 }
 public frmSelectProperty(Model.Product product, Company company)
 {
     InitializeComponent();
     this.Dock          = DockStyle.Fill;
     this.m_Product     = product;
     this.m_Company     = company;
     m_Product.Quantity = 1;
     lblNotify1.Text    = "";
     m_QuotationDetail  = new Model.QuotationDetail();
     FormUtility.FormatForm(this);
 }
Exemple #5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (m_Product == null)
            {
                return;
            }
            m_QuotationDetail = new QuotationDetail();
            using (IUnitOfWork uow = new UnitOfWork())
            {
                m_Product = uow.ProductRepository.Find(m_Product.ProductId);
                uow.Commit();
            }
            if (m_Product == null)
            {
                lblNotify1.SetText(UI.productnotfound, ToolBoxCS.LabelNotify.EnumStatus.Failed);
                return;
            }
            m_QuotationDetail.ProductId = m_Product.ProductId;
            m_QuotationDetail.Product   = m_Product;
            m_QuotationDetail.Quantity  = string.IsNullOrWhiteSpace(txtQuantity.Text) == true ? 0 : Convert.ToInt32(txtQuantity.Text);
            if (m_QuotationDetail.Quantity == 0)
            {
                lblNotify1.SetText(UI.hasnotquantity, ToolBoxCS.LabelNotify.EnumStatus.Failed);
                return;
            }
            m_QuotationDetail.QuotationPrice = CurrencyUtility.ToDecimal(txtQuotationPrice.Text);
            m_QuotationDetail.BasePrice      = CurrencyUtility.ToDecimal(txtPrice.Text);
            if (m_QuotationDetail.QuotationPrice == 0)
            {
                lblNotify1.SetText(UI.hasnotprice, ToolBoxCS.LabelNotify.EnumStatus.Failed);
                return;
            }
            CoverObjectUtility.GetAutoBindingData(this, m_QuotationDetail);

            if (SaveSelectedProperty != null)
            {
                SaveSelectedProperty(m_QuotationDetail);
            }
            ((Form)this.TopLevelControl).Close();
        }