Пример #1
0
        private void POEntering_Load(object sender, EventArgs e)
        {
            try
            {
                txtPONO.Text = PONO;
                objPO        = objPO_DL.Get(txtPONO.Text);
                Supplier objSup = objSupplier_DL.Get(objPO.POSupplierID);

                dtpReqDate.Value        = objPO.PORequiredDate;
                txtPaymentType.Text     = objPO.POPaymentType;
                txtPOReference.Text     = objPO.POReference;
                txtSupplierDetails.Text = objSup.SupplieName + " - " + objSup.SupplierAddress;

                dtPOMaterials = objPOMaterials_DL.Get_ByPOID(PONO);

                gvPOMaterials.AutoGenerateColumns = false;
                objSourcePOMaterials.DataSource   = dtPOMaterials;
                gvPOMaterials.DataSource          = objSourcePOMaterials;
                objSourcePOMaterials.ResetBindings(true);

                dtMaterials = objPOMaterials_DL.Get_ByPOID(PONO);
                objSourceMaterials.DataSource = dtMaterials;
                cmbMaterials.DataSource       = objSourceMaterials;

                Load_DeliveryShedules();
            }
            catch (Exception ex)
            {
            }
        }
Пример #2
0
        private void gvSupplier_CellClick_1(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                objSupplier = objSupplierDL.Get(Convert.ToInt64(gvSupplier.CurrentRow.Cells["SupplierID"].Value));

                txtAddress.Text       = objSupplier.SupplierAddress;
                txtContactPerson.Text = objSupplier.SupplierContactPerson;
                txtEmail.Text         = objSupplier.SupplierEmail;
                txtFax.Text           = objSupplier.SupplierFax;
                txtMobile.Text        = objSupplier.SupplierMobile;
                txtName.Text          = objSupplier.SupplieName;
                txtPhone.Text         = objSupplier.SupplierPhone;
                txtVATNumber.Text     = objSupplier.SupplierVATNo;
                cbVAT.Checked         = objSupplier.SupplierVat;
                cbEnable.Checked      = objSupplier.SupplierStatus;
                txtCode.Text          = objSupplier.SupplierCode;

                cmbSupplierCategory.Text = objSupplier.SupplierType;

                this.SupplierSelect = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #3
0
        private void txtSupplier_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                frmSupplierSelection objForm = new frmSupplierSelection(MatCat);
                objForm.ShowDialog(this);

                objSupplier = objSupplier_DL.Get(objForm.SelectedSupplier);

                txtSupplierCode.Text = objSupplier.SupplierID.ToString();
                txtSupplier.Text     = objSupplier.SupplieName;
                txtRemarks.Select();
            }
        }
Пример #4
0
        private void cmbSupplier_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (cmbSupplier.SelectedValue != null)
                {
                    objSupplier = objSupplier_DL.Get(Convert.ToInt64(cmbSupplier.SelectedValue));

                    txtSupplierDetails.Text = objSupplier.SupplieName + " - " + objSupplier.SupplierAddress + " Phone :" + objSupplier.SupplierPhone + " Mob : " + objSupplier.SupplierMobile;
                }
            }
            catch (Exception ex)
            {
            }
        }
Пример #5
0
        private void txtDeliverNote_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    frmTGRNSelection objForm = new frmTGRNSelection(CurrentUser, MatCat);
                    objForm.ShowDialog(this);
                    SelectedTGRN = objForm.SelectedTGRN;

                    Load_Data();

                    txtDeliverNote.Text     = dt.Rows[0]["DeliverNoteNo"].ToString();
                    txtSupplier.Text        = objSupplier_DL.Get(Convert.ToInt64(dt.Rows[0]["SupplierCode"])).SupplieName;
                    txtDeliverNote.ReadOnly = true;
                    txtPONo.Select();
                    txtRemarks.Text = dt.Rows[0]["Remarks"].ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #6
0
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == Keys.End)
            {
                DialogResult TheResult = MessageBox.Show(this, "Have you Finished Entering Details", "Confirmation", MessageBoxButtons.YesNo);

                if (TheResult == System.Windows.Forms.DialogResult.Yes)
                {
                    if (objCollec.Count > 0)
                    {
                        DeliverNoteMaterials_DL objDeliverNoteMaterials_DL = new DeliverNoteMaterials_DL(ConnectionStringClass.GetConnection());

                        DeliverNote obj = new DeliverNote();

                        obj.DeleveryNoteID       = txtDeliverNote.Text;
                        obj.DeleveryNoteEnterdBy = objEmployee_DL.Get(CurrentUser.EmployeeID);
                        obj.DeleveryNoteStatus   = DeliverNote.Status.Initial;
                        obj.DeleveryNoteDate     = DateTime.Today;
                        obj.DeleveryNotePO       = txtPONO.Text;
                        obj.Remarks  = txtRemarks.Text;
                        obj.Supplier = objSupplier_DL.Get(objPO.POSupplierID).SupplierID;

                        objDeliverNote_DL.Add_Import(obj);


                        foreach (DeliverNoteMaterials tmpobj in objCollec)
                        {
                            tmpobj.DeliverNote = obj.DeleveryNoteID;

                            objDeliverNoteMaterials_DL.Add(tmpobj);
                        }



                        objCollec = null;

                        dgvDeliverNoteList.AutoGenerateColumns = false;

                        objSourceDeliverNotes.DataSource = objCollec;
                        dgvDeliverNoteList.DataSource    = objSourceDeliverNotes;
                        objSourceDeliverNotes.ResetBindings(true);

                        txtDeliverNote.Text  = "";
                        txtSupplier.Text     = "";
                        txtPONO.Text         = "";
                        txtSupplierCode.Text = "";
                        txtDeliverNote.Select();
                        txtRemarks.Text = "";
                    }
                }

                return(true); // indicate that you handled this keystroke
            }

            if (keyData == Keys.F1)
            {
                frmTGRNList objForm = new frmTGRNList(CurrentUser, MatCat);
                objForm.ShowDialog(this);
            }


            if (keyData == Keys.Escape)
            {
                DialogResult TheResult = MessageBox.Show(this, "Do you want to Exit", "Confirm", MessageBoxButtons.YesNo);

                if (TheResult == System.Windows.Forms.DialogResult.Yes)
                {
                    this.Close();
                }
            }
            // Call the base class
            return(base.ProcessCmdKey(ref msg, keyData));
        }