예제 #1
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            string Action = this.GridViewLR.Columns[e.ColumnIndex].HeaderText;

            if (Action == "Edit")
            {
                frmEntryLRNote frm = new frmEntryLRNote();
                ConsignmentId     = Convert.ToInt32(GridViewLR.Rows[e.RowIndex].Cells[0].Value);
                frm.Consignmentid = ConsignmentId;
                frm.FormClosed   += frm_FormClosed;
                frm.ShowInTaskbar = false;
                frm.ShowDialog();
            }

            if (Action == "Delete")
            {
                try
                {
                    ConsignmentId = Convert.ToInt32(GridViewLR.Rows[e.RowIndex].Cells[0].Value);
                    var messageBoxResult = MessageBox.Show("Are you sure want to delete this record?", "Delete", MessageBoxButtons.YesNo);
                    if (messageBoxResult == DialogResult.Yes)
                    {
                        var result = ConsignmentNoteBusinessLogic.Delete(ConsignmentId);
                        MessageBox.Show("Party deleted successfully.");
                        fillgriddata();
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Party already used some where else can't deleted successfully.");
                }
            }
        }
        public JsonResult DeleteConsignmentNote(int ConsignmentNoteId)
        {
            var result = ConsignmentNoteBusinessLogic.Delete(ConsignmentNoteId);

            if (result)
            {
                return(Json(new { Success = true, Message = "Delete Successfully." }));
            }
            return(Json(new { Success = false, Message = "Error in transaction." }));
        }
        public ActionResult Save(int id)
        {
            tblConsignmentNoteDTO tblConsignmentNoteDTO;

            if (id == 0)
            {
                tblConsignmentNoteDTO = new tblConsignmentNoteDTO();
            }
            else
            {
                tblConsignmentNoteDTO = ConsignmentNoteBusinessLogic.Get(id);
            }
            tblConsignmentNoteDTO = FillDropDown(tblConsignmentNoteDTO);
            return(View(tblConsignmentNoteDTO));
        }
        public ActionResult Save(tblConsignmentNoteDTO tblConsignmentNoteDTO)
        {
            if (ModelState.IsValid)
            {
                var resultCheckDuplicateConsignmentNoteNo = ConsignmentNoteBusinessLogic.CheckDuplicateConsignmentNoteNo(tblConsignmentNoteDTO.ConsignmentId, tblConsignmentNoteDTO.ConsignmentNoteNo ?? 0);
                if (resultCheckDuplicateConsignmentNoteNo)
                {
                    ModelState.AddModelError("ConsignmentNoteNo", "Consignment Note No already exists.");
                }
                else
                {
                    tblConsignmentNoteDTO.FinalAmount = (tblConsignmentNoteDTO.Amount1
                                                         + tblConsignmentNoteDTO.Amount2
                                                         + tblConsignmentNoteDTO.Amount3
                                                         + tblConsignmentNoteDTO.Amount4
                                                         + tblConsignmentNoteDTO.Amount5);

                    var result = ConsignmentNoteBusinessLogic.Save(tblConsignmentNoteDTO);
                    return(RedirectToAction("Index"));
                }
            }
            tblConsignmentNoteDTO = FillDropDown(tblConsignmentNoteDTO);
            return(View(tblConsignmentNoteDTO));
        }
예제 #5
0
        public void fillgriddata()
        {
            var Lrlist = ConsignmentNoteBusinessLogic.GetAll();

            GridViewLR.DataSource = Lrlist;
        }
        public ActionResult _AjaxGetConsignmentNote()
        {
            var ConsignmentNoteList = ConsignmentNoteBusinessLogic.GetAll();

            return(View(new GridModel(ConsignmentNoteList)));
        }
예제 #7
0
 void frmEntryLRNote_Load(object sender, EventArgs e)
 {
     if (Consignmentid > 0)
     {
         var LRdetail = ConsignmentNoteBusinessLogic.Get(Consignmentid);
         txtCompanyName.Text          = LRdetail.CompanyName;
         txtActualWeightInKg.Text     = LRdetail.ActualWtInKGS;
         txtAddressOfIssueOffice.Text = LRdetail.AddressofIssuing;
         txtAdvancePaymentAmount.Text = LRdetail.AdvancedPaymentAmount;
         txtAmount1.Text                    = (LRdetail.Amount1).ToString();
         txtAmount2.Text                    = (LRdetail.Amount2).ToString();
         txtAmount3.Text                    = (LRdetail.Amount3).ToString();
         txtAmount4.Text                    = (LRdetail.Amount4).ToString();
         txtAmount5.Text                    = (LRdetail.Amount5).ToString();
         txtBasicOfBooking.Text             = LRdetail.BasicOfBooking;
         txtBilledWith.Text                 = LRdetail.BilledWithMs;
         txtBranchCode.Text                 = LRdetail.BranchCode;
         txtBusinessType.Text               = LRdetail.BusinessType;
         txtCentralisedServiceTaxRegNo.Text = LRdetail.CentralisedServiceTaxRegnNo;
         txtCharges1.Text                   = LRdetail.Charges1;
         txtCharges2.Text                   = LRdetail.Charges2;
         txtCharges3.Text                   = LRdetail.Charges3;
         txtCharges4.Text                   = LRdetail.Charges4;
         txtCharges5.Text                   = LRdetail.Charges5;
         txtChargeWeightInKg.Text           = LRdetail.CategoryOfLoad;
         txtCompanyAmount.Text              = (LRdetail.CompanyAmount).ToString();
         txtCompanyPhoneNo.Text             = LRdetail.CompanyPhone;
         txtConsigneeServiceTaxRegNo.Text   = LRdetail.ConsigneeServiceTaxRegNo;
         txtConsignmentNoteNo.Text          = (LRdetail.ConsignmentNoteNo).ToString();
         txtConsignorServiceTaxRegNo.Text   = LRdetail.ConsignorServiceTaxRegNo;
         txtDeclaredValueGoods.Text         = LRdetail.DeclaredValueOfGoods;
         txtDescription.Text                = LRdetail.DescriptionSaidToContain;
         txtDiamentionNoOfPkgs.Text         = LRdetail.DimensionNoOfPKGS;
         txtDistance.Text                   = LRdetail.Distance;
         txtFinalAmount.Text                = (LRdetail.FinalAmount).ToString();
         txtFromCodeName.Text               = LRdetail.FromCode;
         txtHeight.Text                       = LRdetail.DimensionHeight;
         txtInvoiceNo.Text                    = LRdetail.ConsigneeInvoiceNo;
         txtKms.Text                          = LRdetail.KMS;
         txtLength.Text                       = LRdetail.DimensionLength;
         txtLoadType.Text                     = LRdetail.LoadType;
         txtMainConsignment.Text              = LRdetail.MainConsignmentNo;
         txtMethodOfPacking.Text              = LRdetail.MethodOfPacking;
         txtMRNo.Text                         = LRdetail.AdvancedPaymentMRNo;
         txtNoOfPackages.Text                 = LRdetail.NoofPackages;
         txtPanNo.Text                        = LRdetail.PanNo;
         txtPartyCode.Text                    = LRdetail.PartyCode;
         txtPolicyNo.Text                     = LRdetail.PolicyNo;
         txtPrivateMarks.Text                 = LRdetail.PrivateMarketOtherIdentificaion;
         txtPurchaseOrderNo.Text              = LRdetail.ConsignorPurchaseOrderNo;
         txtRate.Text                         = LRdetail.Rate;
         txtRate2.Text                        = LRdetail.Rate;
         txtRebooking.Text                    = LRdetail.Rebooking;
         txtServiceTaxThrough.Text            = LRdetail.ServicetaxThrough;
         txtSinglePiece.Text                  = LRdetail.DimensionSinglePieceWeight;
         txtToCodeName.Text                   = LRdetail.ToCode;
         txtToPay.Text                        = LRdetail.ToPay;
         txtTotalCFT.Text                     = LRdetail.DimensionTotalCFTCMT;
         txtValidType.Text                    = LRdetail.ValidType;
         txtWidth.Text                        = LRdetail.DimensionWidth;
         cmbServiceTaxisPaybleBy.SelectedItem = LRdetail.ServiceTaxisPayableBy;
     }
     loadConsigneeName();
     loadConsignorName();
 }
예제 #8
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (ValidateData())
            {
                if (txtAmount1.Text.Trim() == "")
                {
                    txtAmount1.Text = "0";
                }
                if (txtAmount2.Text.Trim() == "")
                {
                    txtAmount2.Text = "0";
                }
                if (txtAmount3.Text.Trim() == "")
                {
                    txtAmount3.Text = "0";
                }
                if (txtAmount4.Text.Trim() == "")
                {
                    txtAmount4.Text = "0";
                }
                if (txtAmount5.Text.Trim() == "")
                {
                    txtAmount5.Text = "0";
                }

                tblConsignmentNoteDTO consignNoteDTO = new tblConsignmentNoteDTO();
                consignNoteDTO.CompanyName              = txtCompanyName.Text;
                consignNoteDTO.PolicyNo                 = txtPolicyNo.Text;
                consignNoteDTO.CompanyDate              = Convert.ToDateTime(dpCompanyDate.Value);
                consignNoteDTO.CompanyAmount            = txtCompanyAmount.Text.Trim() == "" ? 0 : Convert.ToDouble(txtCompanyAmount.Text);
                consignNoteDTO.ConsigneeId              = Convert.ToInt32(cmbConsineeName.SelectedValue);
                consignNoteDTO.ConsigneeInvoiceNo       = txtInvoiceNo.Text;
                consignNoteDTO.ConsigneeServiceTaxRegNo = txtConsigneeServiceTaxRegNo.Text;
                consignNoteDTO.ConsignorId              = Convert.ToInt32(cmbConsignorName.SelectedValue);
                consignNoteDTO.ConsignorPurchaseOrderNo = txtPurchaseOrderNo.Text;
                consignNoteDTO.ConsignorServiceTaxRegNo = txtConsignorServiceTaxRegNo.Text;
                consignNoteDTO.PanNo = txtPanNo.Text;
                consignNoteDTO.CentralisedServiceTaxRegnNo = txtCentralisedServiceTaxRegNo.Text;
                consignNoteDTO.FromCode          = txtFromCodeName.Text;
                consignNoteDTO.ConsignmentNoteNo = txtConsignmentNoteNo.Text.Trim() == "" ? 0 : Convert.ToInt32(txtConsignmentNoteNo.Text);
                consignNoteDTO.ConsignmentDate   = Convert.ToDateTime(dpConsignmentDate.Value);
                consignNoteDTO.AddressofIssuing  = txtAddressOfIssueOffice.Text;
                consignNoteDTO.ToCode            = txtToCodeName.Text;
                consignNoteDTO.CompanyPhone      = txtCompanyPhoneNo.Text;
                consignNoteDTO.NoofPackages      = txtNoOfPackages.Text;
                consignNoteDTO.MethodOfPacking   = txtMethodOfPacking.Text;
                consignNoteDTO.ActualWtInKGS     = txtActualWeightInKg.Text;
                consignNoteDTO.CategoryOfLoad    = txtChargeWeightInKg.Text;
                consignNoteDTO.Rate                            = txtRate.Text;
                consignNoteDTO.Charges1                        = txtCharges1.Text;
                consignNoteDTO.Amount1                         = double.Parse(txtAmount1.Text);
                consignNoteDTO.LoadType                        = txtLoadType.Text;
                consignNoteDTO.Distance                        = txtDistance.Text;
                consignNoteDTO.KMS                             = txtKms.Text;
                consignNoteDTO.Charges1                        = txtCharges1.Text;
                consignNoteDTO.Charges2                        = txtCharges2.Text;
                consignNoteDTO.Amount2                         = double.Parse(txtAmount2.Text);
                consignNoteDTO.Charges3                        = txtCharges3.Text;
                consignNoteDTO.Charges4                        = txtCharges4.Text;
                consignNoteDTO.AdvancedPaymentDate             = Convert.ToDateTime(dpAdvancePaymentDate.Value);
                consignNoteDTO.Charges5                        = txtCharges5.Text;
                consignNoteDTO.Amount3                         = txtAmount3.Text.Trim() == "" ? 0 : Convert.ToDouble(txtAmount3.Text);
                consignNoteDTO.Amount4                         = txtAmount4.Text.Trim() == "" ? 0 : Convert.ToDouble(txtAmount4.Text);
                consignNoteDTO.Amount5                         = txtAmount5.Text.Trim() == "" ? 0 : Convert.ToDouble(txtAmount5.Text);
                txtFinalAmount.Text                            = (Convert.ToDouble(txtAmount1.Text) + Convert.ToDouble(txtAmount2.Text) + Convert.ToDouble(txtAmount3.Text) + Convert.ToDouble(txtAmount4.Text) + Convert.ToDouble(txtAmount5.Text)).ToString();
                consignNoteDTO.FinalAmount                     = Convert.ToDouble(txtFinalAmount.Text);
                consignNoteDTO.PrivateMarketOtherIdentificaion = txtPrivateMarks.Text;
                consignNoteDTO.AdvancedPaymentAmount           = txtAdvancePaymentAmount.Text;
                consignNoteDTO.BusinessType                    = txtBusinessType.Text;
                consignNoteDTO.DeclarationNo                   = txtDeclaredValueGoods.Text;
                consignNoteDTO.DimensionLength                 = txtLength.Text;
                consignNoteDTO.DimensionWidth                  = txtWidth.Text;
                consignNoteDTO.DimensionHeight                 = txtHeight.Text;
                consignNoteDTO.DimensionNoOfPKGS               = txtDiamentionNoOfPkgs.Text;
                consignNoteDTO.DimensionTotalCFTCMT            = txtTotalCFT.Text;
                consignNoteDTO.DimensionSinglePieceWeight      = txtSinglePiece.Text;
                consignNoteDTO.ValidType                       = txtValidType.Text;
                consignNoteDTO.DeclaredValueOfGoods            = txtDeclaredValueGoods.Text;
                consignNoteDTO.ServicetaxThrough               = txtServiceTaxThrough.Text;
                consignNoteDTO.BasicOfBooking                  = txtBasicOfBooking.Text;
                consignNoteDTO.BilledWithMs                    = txtBilledWith.Text;
                consignNoteDTO.BranchCode                      = txtBranchCode.Text;
                consignNoteDTO.PartyCode                       = txtPartyCode.Text;
                consignNoteDTO.ToPay                           = txtToPay.Text;
                consignNoteDTO.Rebooking                       = txtRebooking.Text;
                consignNoteDTO.MainConsignmentNo               = txtMainConsignment.Text;
                consignNoteDTO.ServiceTaxisPayableBy           = (cmbServiceTaxisPaybleBy.SelectedItem).ToString();
                consignNoteDTO.ConsignmentId                   = Consignmentid;


                var resultCheckDuplicateConsignmentNoteNo = ConsignmentNoteBusinessLogic.CheckDuplicateConsignmentNoteNo(Consignmentid, Convert.ToInt32(txtConsignmentNoteNo.Text));
                if (resultCheckDuplicateConsignmentNoteNo)
                {
                    MessageBox.Show("Consignment Number already exists.");
                    txtConsignmentNoteNo.Focus();
                }
                else
                {
                    var result = ConsignmentNoteBusinessLogic.Save(consignNoteDTO);
                    if (result > 0)
                    {
                        MessageBox.Show("LR Note Successfully Generate");
                        if (Consignmentid > 0)
                        {
                            this.Close();
                        }
                        else
                        {
                            clearData();
                        }
                    }
                }
            }
        }
예제 #9
0
 public void loadConsignorName()
 {
     cmbConsignorName.DataSource    = ConsignmentNoteBusinessLogic.GetAll();
     cmbConsignorName.ValueMember   = "ConsignorId";
     cmbConsignorName.DisplayMember = "ConsignorName";
 }