Beispiel #1
0
        private void gridViewParty_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            string Action = this.gridViewParty.Columns[e.ColumnIndex].HeaderText;

            if (Action == "Edit")
            {
                frmParty frmParty = new frmParty();
                PartyId                = Convert.ToInt32(gridViewParty.Rows[e.RowIndex].Cells[0].Value);
                frmParty.PartyId       = PartyId;
                frmParty.FormClosed   += frmParty_FormClosed;
                frmParty.ShowInTaskbar = false;
                frmParty.Show();
            }

            if (Action == "Delete")
            {
                try
                {
                    PartyId = Convert.ToInt32(gridViewParty.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 = ConsignorBusinessLogic.Delete(PartyId);
                        MessageBox.Show("Party deleted successfully.");
                        FillGridData();
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Party already used some where else can't deleted successfully.");
                }
            }
        }
        private tblConsignmentNoteDTO FillDropDown(tblConsignmentNoteDTO tblConsignmentNoteDTO)
        {
            var partyList = ConsignorBusinessLogic.GetAll();

            foreach (var item in partyList)
            {
                item.PartyNameWithCode = item.Code + "-" + item.ConsignorName;
            }
            tblConsignmentNoteDTO.ConsigneeList = partyList.Where(type => type.Type == 1).ToList();
            tblConsignmentNoteDTO.ConsignorList = partyList.Where(type => type.Type == 2).ToList();

            //-------------------
            tblConsignmentNoteDTO.ServiceTaxisPayableByList = new List <SelectListItem>();
            tblConsignmentNoteDTO.ServiceTaxisPayableByList.Add(new SelectListItem {
                Value = "CONSIGNOR", Text = "CONSIGNOR"
            });
            tblConsignmentNoteDTO.ServiceTaxisPayableByList.Add(new SelectListItem {
                Value = "CONSIGNEE", Text = "CONSIGNEE"
            });
            tblConsignmentNoteDTO.ServiceTaxisPayableByList.Add(new SelectListItem {
                Value = "Transport", Text = "Transport"
            });

            return(tblConsignmentNoteDTO);
        }
        public JsonResult DeleteConsignor(int id)
        {
            var result = ConsignorBusinessLogic.Delete(id);

            if (result)
            {
                return(Json(new { Success = true, Message = "Delete Successfully." }));
            }
            return(Json(new { Success = false, Message = "Error in transaction." }));
        }
Beispiel #4
0
        private void FillPartys()
        {
            var partyList = ConsignorBusinessLogic.GetAll();
            foreach (var item in partyList)
            {
                item.PartyNameWithCode = item.Code + "-" + item.ConsignorName;
            }

            partyList.Insert(0, new tblConsignorDTO { ConsignorId = 0, PartyNameWithCode = "Select" });
            cbPartyWise.DataSource = partyList;
        }
Beispiel #5
0
 private void FillDropDown()
 {
     var partyList = ConsignorBusinessLogic.GetAll();
     foreach (var item in partyList)
     {
         item.PartyNameWithCode = item.Code + "-" + item.ConsignorName;
     }
     cmbParty.DataSource = partyList;
     cmbParty.DisplayMember = "PartyNameWithCode";
     cmbParty.ValueMember = "ConsignorId";
 }
Beispiel #6
0
        public ActionResult BillPartyWiseReport(ReportBillPartyWiseSearch reportBillPartyWiseSearch)
        {
            reportBillPartyWiseSearch.IsSearchClick = true;
            var partyList = ConsignorBusinessLogic.GetAll();

            foreach (var item in partyList)
            {
                item.PartyNameWithCode = item.Code + "-" + item.ConsignorName;
            }
            reportBillPartyWiseSearch.PartyList = partyList;
            reportBillPartyWiseSearch.PartyList.Insert(0, new tblConsignorDTO {
                ConsignorId = 0, PartyNameWithCode = "Select"
            });
            return(View(reportBillPartyWiseSearch));
        }
        public ActionResult Save(int id)
        {
            tblConsignorDTO tblConsignorDTO;

            if (id == 0)
            {
                tblConsignorDTO = new tblConsignorDTO();
            }
            else
            {
                tblConsignorDTO = ConsignorBusinessLogic.Get(id);
            }
            tblConsignorDTO = FillDropDown(tblConsignorDTO);
            return(View(tblConsignorDTO));
        }
        public ActionResult _AjaxGetConsignor()
        {
            var ConsignorList = ConsignorBusinessLogic.GetAll();

            foreach (var item in ConsignorList)
            {
                if (item.Type == 1)
                {
                    item.PartyType = "Consignor";
                }
                else
                {
                    item.PartyType = "Consignee";
                }
            }
            return(View(new GridModel(ConsignorList)));
        }
Beispiel #9
0
        private void FillGridData()
        {
            var consignorList = ConsignorBusinessLogic.GetAll();

            foreach (var item in consignorList)
            {
                if (item.Type == 1)
                {
                    item.PartyType = "Consignor";
                }
                else
                {
                    item.PartyType = "Consignee";
                }
            }
            gridViewParty.DataSource = consignorList;
        }
Beispiel #10
0
        public ActionResult BillPartyWiseReport()
        {
            var reportBillPartyWiseSearch = new ReportBillPartyWiseSearch();

            reportBillPartyWiseSearch.IsSearchClick = false;
            reportBillPartyWiseSearch.StartDate     = DateTime.Today.AddMonths(-2).ToShortDateString();
            reportBillPartyWiseSearch.EndDate       = DateTime.Today.ToShortDateString();
            var partyList = ConsignorBusinessLogic.GetAll();

            foreach (var item in partyList)
            {
                item.PartyNameWithCode = item.Code + "-" + item.ConsignorName;
            }
            reportBillPartyWiseSearch.PartyList = partyList;
            reportBillPartyWiseSearch.PartyList.Insert(0, new tblConsignorDTO {
                ConsignorId = 0, PartyNameWithCode = "Select"
            });
            return(View(reportBillPartyWiseSearch));
        }
 public ActionResult Save(tblConsignorDTO tblConsignorDTO)
 {
     if (ModelState.IsValid)
     {
         if (ConsignorBusinessLogic.CheckDuplicateCodeExists(tblConsignorDTO.Code, tblConsignorDTO.ConsignorId) == false)
         {
             tblConsignorDTO.CreationDate = DateTime.Now;
             var result = ConsignorBusinessLogic.Save(tblConsignorDTO);
             if (result > 0)
             {
                 return(RedirectToAction("Index"));
             }
         }
         else
         {
             ModelState.AddModelError("Code", "Code already exists.");
         }
     }
     tblConsignorDTO = FillDropDown(tblConsignorDTO);
     return(View(tblConsignorDTO));
 }
        private tblBillDTO FillDropDown(tblBillDTO tblBillDTO)
        {
            var partyList = ConsignorBusinessLogic.GetAll();

            foreach (var item in partyList)
            {
                item.PartyNameWithCode = item.Code + "-" + item.ConsignorName;
            }
            tblBillDTO.PartyList = partyList;
            //-------------------
            tblBillDTO.BillTypeList = new List <SelectListItem>();
            tblBillDTO.BillTypeList.Add(new SelectListItem {
                Value = "FREIGHT", Text = "FREIGHT"
            });
            tblBillDTO.BillTypeList.Add(new SelectListItem {
                Value = "OCTROI", Text = "OCTROI"
            });
            tblBillDTO.BillTypeList.Add(new SelectListItem {
                Value = "SUPPLER", Text = "SUPPLER"
            });
            tblBillDTO.BillTypeList.Add(new SelectListItem {
                Value = "MISC", Text = "MISC"
            });
            tblBillDTO.BillTypeList.Add(new SelectListItem {
                Value = "Others", Text = "Others"
            });
            //-------------------
            tblBillDTO.ServiceTaxThroughList = new List <SelectListItem>();
            tblBillDTO.ServiceTaxThroughList.Add(new SelectListItem {
                Value = "CONSIGNOR", Text = "CONSIGNOR"
            });
            tblBillDTO.ServiceTaxThroughList.Add(new SelectListItem {
                Value = "CONSIGNEE", Text = "CONSIGNEE"
            });
            tblBillDTO.ServiceTaxThroughList.Add(new SelectListItem {
                Value = "BRC", Text = "BRC"
            });
            //-------------------
            return(tblBillDTO);
        }
Beispiel #13
0
        private void frmPartys_Load(object sender, EventArgs e)
        {
            if (PartyId > 0)
            {
                var partyDetails = ConsignorBusinessLogic.Get(PartyId);

                txtPartyName.Text = partyDetails.ConsignorName;
                txtCode.Text      = partyDetails.Code;
                if (partyDetails.Type == 1)
                {
                    cbType.SelectedItem = "Consignor";
                }
                else
                {
                    cbType.SelectedItem = "Consignee";
                }
                txtAddress.Text     = partyDetails.Address;
                txtPhoneNo.Text     = partyDetails.PhoneNo;
                txtSTNOCSTNO.Text   = partyDetails.STNOCSTNO;
                txtTINNOVATNO.Text  = partyDetails.TINNOVATNO;
                txtDescription.Text = partyDetails.Description;
            }
        }
Beispiel #14
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (IsFormValidate())
            {
                tblConsignorDTO tblConsignorDTO = new tblConsignorDTO();

                tblConsignorDTO.ConsignorId   = PartyId;
                tblConsignorDTO.ConsignorName = txtPartyName.Text;
                tblConsignorDTO.Code          = txtCode.Text;
                if (Convert.ToString(cbType.SelectedItem) == "Consignor")
                {
                    tblConsignorDTO.Type = 1;
                }
                else
                {
                    tblConsignorDTO.Type = 2;
                }
                tblConsignorDTO.Address     = txtAddress.Text;
                tblConsignorDTO.PhoneNo     = txtPhoneNo.Text;
                tblConsignorDTO.STNOCSTNO   = txtSTNOCSTNO.Text;
                tblConsignorDTO.TINNOVATNO  = txtTINNOVATNO.Text;
                tblConsignorDTO.Description = txtDescription.Text;
                if (ConsignorBusinessLogic.CheckDuplicateCodeExists(tblConsignorDTO.Code, tblConsignorDTO.ConsignorId) == false)
                {
                    tblConsignorDTO.CreationDate = DateTime.Now;
                    var result = ConsignorBusinessLogic.Save(tblConsignorDTO);
                    if (PartyId > 0)
                    {
                        this.Close();
                    }
                }
                else
                {
                    MessageBox.Show("Code already exists.");
                }
            }
        }