Exemplo n.º 1
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Process, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes)
            {
                try
                {
                    T_CreditNoteHead alloc = new T_CreditNoteHead();
                    alloc.Dono = txt_DocNo.Text.Trim();
                    alloc      = new T_CreditNoteHeadDL().Selectt_CreditNoteHead(alloc);
                    decimal cumilative = decimal.Zero;

                    foreach (DataGridViewRow drowx in dgsave.Rows)
                    {
                        T_CNParts part = new T_CNParts();
                        part.CNno      = drowx.Cells[0].Value.ToString().Trim();
                        part.ItemCode  = drowx.Cells[2].Value.ToString().Trim();
                        part.PartCode  = drowx.Cells[4].Value.ToString().Trim();
                        part.TagNumber = drowx.Cells[1].Value.ToString().Trim();

                        part           = new T_CNPartDL().Selectt_CNPart(part);
                        part.Processed = true;
                        new T_CNPartDL().Savet_CNPartSP(part, 3);
                    }
                }
                catch (Exception ex) { }
            }
        }
        private void btn_edit_Click(object sender, EventArgs e)
        {
            if (codex.Trim() != "")
            {
                if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Approve, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes)
                {
                    T_CreditNoteHead objt_trnsferNote = new T_CreditNoteHead();
                    objt_trnsferNote.DocNo = txt_DocNo.Text.Trim();

                    objt_trnsferNote = new T_CreditNoteHeadDL().Selectt_CreditNoteHead(objt_trnsferNote);

                    objt_trnsferNote.Approved     = true;
                    objt_trnsferNote.ApprovedDate = DateTime.Now;
                    objt_trnsferNote.ApprovedUser = commonFunctions.Loginuser;
                    new T_CreditNoteHeadDL().Savet_CreditNoteHeadSP(objt_trnsferNote, 3);

                    //T_OrderTracking track = new T_OrderTracking();
                    //track.OFNo = objt_trnsferNote.OrderFormNo.Trim();
                    //track = new T_OrderTrackingDL().Selectt_OrderTracking(track, xEnums.OrderTrackingTypes.OrderNo);
                    //track.InvApproved = 1;
                    //track.InvApprovedDate = DateTime.Now;
                    //track.InvApprovedUser = commonFunctions.Loginuser;
                    //new T_OrderTrackingDL().Savet_OrderTrackingSP(track, 3);

                    getProcessedInvoices();
                    LoadDetails("");
                    UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_Update_Sucess, commonFunctions.Softwarename.Trim());
                }
            }
            else
            {
                errorProvider1.SetError(dataGridView1, "Pelase select a order form from the list");
            }
        }
Exemplo n.º 3
0
        private void FindExisitingCN(string GrnNo)
        {
            if (GrnNo.Trim() != "")
            {
                if (T_CreditNoteHeadDL.ExistingT_CreditNoteHead(GrnNo.Trim()))
                {
                    T_CreditNoteHead cat = new T_CreditNoteHead();
                    cat.DocNo = GrnNo.Trim();
                    cat       = new T_CreditNoteHeadDL().Selectt_CreditNoteHead(cat);

                    if (cat.Grouped == true)
                    {
                        lbl_processes.Text    = "Grouped".ToUpper();
                        lbl_processes.Visible = true;
                        //errorProvider1.SetError(txt_DocNo, "Credit Note is already grouped.");
                        // commonFunctions.SetMDIStatusMessage("Credit Note is already grouped.", 1);
                        // return;
                    }
                    dtxCN.Clear();
                    dataGridView2.Refresh();
                    //clear error fields
                    errorProvider1.Clear();
                    //load and disable the data fields
                    txt_LocaCode.Text = cat.LocaCode.Trim();
                    txt_Customer.Text = cat.CustomerID.Trim();
                    txt_ManualID.Text = cat.ManualID.Trim();

                    dtxCN = GetCBBreakdowns(GrnNo);
                    dataGridView2.DataSource = dtxCN;
                    commonFunctions.FormatDataGrid(dataGridView2);
                    dataGridView2.Columns[0].Visible = false;
                    dataGridView2.Columns[1].Width   = 90;
                    dataGridView2.Columns[2].Width   = 100;
                    dataGridView2.Columns[4].Width   = 90;
                    dataGridView2.Columns[5].Width   = 50;
                    dataGridView2.Columns[6].Width   = 200;

                    LoadPartSaved(GrnNo);
                }
                else
                {
                    //if (formMode != 1)
                    //{
                    lbl_processes.Text    = "Invalied".ToUpper();
                    lbl_processes.Visible = true;
                    errorProvider1.SetError(txt_DocNo, "Invalied Credit Note Number.");
                    commonFunctions.SetMDIStatusMessage("Invalied Credit Note Number.", 1);
                    //}
                }
            }
            else
            {
                lbl_processes.Text    = "".ToUpper();
                lbl_processes.Visible = true;
                commonFunctions.SetMDIStatusMessage("Please Enter Credit Note Number.", 2);
            }
        }
Exemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Add, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes)
            {
                try
                {
                    T_CreditNoteHead alloc = new T_CreditNoteHead();
                    alloc.Dono = txt_DocNo.Text.Trim();
                    alloc      = new T_CreditNoteHeadDL().Selectt_CreditNoteHead(alloc);
                    decimal cumilative = decimal.Zero;

                    foreach (DataGridViewRow drowx in dataGridView1.Rows)
                    {
                        if (commonFunctions.ToDecimal(drowx.Cells[2].Value.ToString().Trim()) != decimal.Zero)
                        {
                            if (!T_CNPartDL.ExistingT_CNPart(txt_DocNo.Text.Trim(), drow.Cells[1].Value.ToString().Trim(), drow.Cells[2].Value.ToString().Trim(), drowx.Cells[0].Value.ToString().Trim()))
                            {
                                T_CNParts part = new T_CNParts();
                                part.CNno          = txt_DocNo.Text.Trim();
                                part.ItemCode      = drow.Cells[2].Value.ToString().Trim();
                                part.PartCode      = drowx.Cells[0].Value.ToString().Trim();
                                part.Processed     = false;
                                part.ProcessedDate = DateTime.Now;
                                part.ProcessedUser = commonFunctions.Loginuser;
                                part.QTY           = commonFunctions.ToDecimal(drowx.Cells[2].Value.ToString().Trim());
                                part.Saved         = false;
                                part.TagNumber     = drow.Cells[1].Value.ToString().Trim();
                                new T_CNPartDL().Savet_CNPartSP(part, 1);
                            }
                        }
                    }

                    LoadPartSaved(txt_DocNo.Text.Trim());
                }
                catch (System.Data.SqlClient.SqlException ex) {
                    commonFunctions.SetMDIStatusMessage("Data Already exists for selected record", 1);
                }
                catch (Exception ex)
                {
                    commonFunctions.SetMDIStatusMessage("Error when adding", 1);
                }
            }
        }
        private void dataGridView1_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            if (dataGridView1.SelectedRows.Count > 0)
            {
                codex = dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
                T_CreditNoteHead cat = new T_CreditNoteHead();
                cat.DocNo = codex.Trim();
                cat       = new T_CreditNoteHeadDL().Selectt_CreditNoteHead(cat);

                txt_DocNo.Text           = cat.DocNo;
                txt_Locacode.Text        = cat.LocaCode.Trim();
                txt_locationId_name.Text = findExisting.FindExisitingLoca(txt_Locacode.Text);
                txt_Customer.Text        = cat.CustomerID.Trim();
                txt_Customer_name.Text   = findExisting.FindExisitingCUstomer(txt_Customer.Text);
                txt_Remarks.Text         = cat.Remarks;
                txt_manualno.Text        = cat.ManualID;
                txt_CNtypes.Text         = cat.TypeX.Trim();
                lbl_creditnotetype.Text  = findExisting.FindExisitingCNType(txt_CNtypes.Text);
                //dte_date.Value = cat.Datex.Value;
                //dte_RecivedDate.Value = cat.RecivedDate.Value;
                LoadDetails(dataGridView1.SelectedRows[0].Cells[0].Value.ToString());
            }
        }