private void QRY_SALES_DESIGN_SUMMARY_Load(object sender, EventArgs e) { DBGrid.Tag = this.Name; clsTranslate.InitLanguage(this); FillControl.FillDesignType(cboFormType, true); FillControl.FillCustomerList(lstCustomer); FillControl.FillEmployeeList(cboSalesMan, true, false); lstCustomer.BackColor = frmOptions.BACKCOLOR; dtpFrom.Value = Util.modperiod.StartDate; dtpTo.Value = Util.modperiod.EndDate; }
private void QRY_SALES_DESIGN_DETAIL_Load(object sender, EventArgs e) { DBGrid.ContextMenuStrip.Items.Add("-"); DBGrid.ContextMenuStrip.Items.Add(clsTranslate.TranslateString("Sales Statement"), LXMS.Properties.Resources.Property, new System.EventHandler(this.mnuSalesStatement_Click)); DBGrid.Tag = this.Name; clsTranslate.InitLanguage(this); FillControl.FillDesignType(cboFormType, true); FillControl.FillCustomerList(lstCustomer); FillControl.FillEmployeeList(cboSalesMan, true, false); lstCustomer.BackColor = frmOptions.BACKCOLOR; dtpFrom.Value = Util.modperiod.StartDate; dtpTo.Value = Util.modperiod.EndDate; }
public void AddItem(string acctype) { _action = "NEW"; dtpFormDate.Value = DateTime.Today; txtId.Text = "0"; txtInvoiceMny.Text = "0"; txtSalesManMny.Text = "0"; txtUnitNo.Text = "PCS"; FillControl.FillDesignType(cboDesignType, false); FillControl.FillReceiveStatus(cboReceiveStatus, false); FillControl.FillInvoiceStatus(cboInvoiceStatus, false); cboReceiveStatus.SelectedIndex = -1; cboInvoiceStatus.SelectedIndex = -1; btnUpdate.Enabled = false; status4.Image = null; }
public void EditItem(int id) { try { this.Cursor = Cursors.WaitCursor; _action = "EDIT"; FillControl.FillDesignType(cboDesignType, false); FillControl.FillReceiveStatus(cboReceiveStatus, false); FillControl.FillInvoiceStatus(cboInvoiceStatus, false); modSalesDesignForm mod = _dal.GetItem(id, out Util.emsg); if (mod != null) { txtId.Text = id.ToString(); dtpFormDate.Value = mod.FormDate; cboDesignType.SelectedValue = mod.FormType; txtCustOrderNo.Text = mod.CustOrderNo; txtNo.Text = mod.No; txtCurrency.Text = mod.Currency; txtCustName.Tag = mod.CustId; txtCustName.Text = mod.CustName; txtPayMethod.Text = mod.PayMethod; txtSalesMan.Text = mod.SalesMan; txtUnitNo.Text = mod.UnitNo; txtQty.Text = mod.Qty.ToString(); txtMny.Text = mod.Mny.ToString(); txtSalesManMny.Text = mod.SalesManMny.ToString(); txtProductName.Text = mod.ProductName; txtRemark.Text = mod.Remark; cboReceiveStatus.SelectedIndex = Convert.ToInt32(mod.ReceiveStatus); cboAccountNo.SelectedValue = mod.AccountNo; txtReceiveDate.Text = mod.ReceiveDate; cboInvoiceStatus.SelectedIndex = mod.InvoiceStatus; txtInvoiceMny.Text = mod.InvoiceMny.ToString(); txtInvoiceNo.Text = mod.InvoiceNo; if (mod.Status == 1) { status4.Image = Properties.Resources.audited; Util.ChangeStatus(this, true); toolSave.Enabled = false; } else { status4.Image = null; toolSave.Visible = true; Util.ChangeStatus(this, false); txtId.ReadOnly = true; toolSave.Enabled = true; } cboReceiveStatus.Enabled = true; cboInvoiceStatus.Enabled = true; cboAccountNo.Enabled = true; txtInvoiceMny.ReadOnly = false; txtInvoiceNo.ReadOnly = false; btnUpdate.Enabled = true; btnReceiveDate.Enabled = true; } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
public void Import(int id) { try { this.Cursor = Cursors.WaitCursor; _action = "NEW"; FillControl.FillDesignType(cboDesignType, false); FillControl.FillReceiveStatus(cboReceiveStatus, false); FillControl.FillInvoiceStatus(cboInvoiceStatus, false); dalCustomerOrderList dal = new dalCustomerOrderList(); modCustomerOrderList mod = dal.GetItem(id, out Util.emsg); if (mod != null) { txtId.Text = "0"; dtpFormDate.Value = DateTime.Today; //cboDesignType.SelectedValue = mod.FormType; txtCustOrderNo.Text = mod.CustOrderNo; txtNo.Text = _dal.GetNewNo(dtpFormDate.Value, mod.CustId); txtCurrency.Text = mod.Currency; txtCustName.Tag = mod.CustId; txtCustName.Text = mod.CustName; txtPayMethod.Text = mod.PayMethod; txtSalesMan.Text = mod.SalesMan; txtUnitNo.Text = mod.UnitNo; txtQty.Text = mod.Qty.ToString(); txtMny.Text = (mod.Qty * mod.Price).ToString(); txtSalesManMny.Text = "0"; txtProductName.Text = mod.ProductName; txtRemark.Text = mod.Remark; txtInvoiceMny.Text = "0"; dalCustomerList dalcust = new DAL.dalCustomerList(); modCustomerList modcust = dalcust.GetItem(mod.CustId, out Util.emsg); if (modcust != null) { //txtCustName.Tag = modcust.CustId; //txtCustName.Text = modcust.CustName; //txtPayMethod.Text = modcust.txtPayMethod; //txtSalesMan.Text = modcust.SalesMan; //txtCurrency.Text = mod.Currency; if (modcust.NeedInvoice == 1) { cboReceiveStatus.SelectedIndex = 0; cboInvoiceStatus.SelectedIndex = 1; } else { cboReceiveStatus.SelectedIndex = 1; cboInvoiceStatus.SelectedIndex = 0; } } status4.Image = null; toolSave.Visible = true; Util.ChangeStatus(this, false); txtId.ReadOnly = true; toolSave.Enabled = true; cboReceiveStatus.Enabled = true; cboInvoiceStatus.Enabled = true; cboAccountNo.Enabled = true; txtInvoiceMny.ReadOnly = false; txtInvoiceNo.ReadOnly = false; btnUpdate.Enabled = true; btnReceiveDate.Enabled = true; } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }