Esempio n. 1
0
        private void txtProductCode_TextChanged(object sender, EventArgs e)
        {
            BL_frmInvoiceItemsEdit M = new BL_frmInvoiceItemsEdit();

            M.ProductCode  = txtProductCode.Text.ToString();
            M.CustomerCode = this.CustomerCode;
            //M.CustomerCode = txtCustomerNumber.Text.ToString();
            txtProductDescrition.Text = M.getProductName();
            txtTechNumber.Text        = M.getProductTechNo();
            //Datagridview1.DataSource = M.AllHistory();

            if (chkJustThisCustomer.Checked == true)
            {
                Datagridview1.DataSource = M.ThisCustomerHistory();
            }
            else
            {
                Datagridview1.DataSource = M.AllHistory();
            }

            this.Datagridview1.DefaultCellStyle.Font = new Font("B Yekan", 10);
            this.Datagridview1.ColumnHeadersDefaultCellStyle.Font = new Font("B Yekan", 9.75F, FontStyle.Bold);

            this.Datagridview1.Columns[0].HeaderText = "تاریخ";
            this.Datagridview1.Columns[0].Width      = 150;
            this.Datagridview1.Columns[1].HeaderText = "نام مشتری";
            this.Datagridview1.Columns[1].Width      = 150;
            this.Datagridview1.Columns[2].HeaderText = "تعداد";
            this.Datagridview1.Columns[2].Width      = 150;
            this.Datagridview1.Columns[3].HeaderText = "قیمت واحد";
            this.Datagridview1.Columns[3].Width      = 150;
        }
Esempio n. 2
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            BL_frmInvoiceItemsEdit M = new BL_frmInvoiceItemsEdit();

            M.ID                   = this.ID;
            M.InvoiceNumber        = this.InvoiceNumber;
            M.FDate                = this.FDate;
            M.CustomerCode         = this.CustomerCode;
            M.CustomerName         = this.CustomerName;
            M.RequestNumber        = this.RequestNumber;
            M.InternalOerderNumber = this.InternalOrderNumber;
            //-------------------------------------------
            M.DraftNumber        = this.txtDraftNumber.Text.ToString();
            M.ProductCode        = this.txtProductCode.Text.ToString();
            M.ProductDescription = this.txtProductDescrition.Text.ToString();
            M.ProductTechNumber  = this.txtTechNumber.Text.ToString();
            M.Quantity           = long.Parse(this.txtQuantity.Text.ToString());
            M.UnitPrice          = long.Parse(this.txtUnitPrice.Text.ToString());
            M.Tax   = double.Parse(this.txtTax.Text.ToString());
            M.Price = double.Parse(this.txtPrice.Text.ToString());
            M.UpdateItem();
            this.Close();
        }