示例#1
0
        private void gridViewBill_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            string Action = this.gridViewBill.Columns[e.ColumnIndex].HeaderText;

            if (Action == "Edit")
            {
                frmEntryBills frmbill = new frmEntryBills();
                frmbill.BillId      = Convert.ToInt32(gridViewBill.Rows[e.RowIndex].Cells[0].Value);
                frmbill.FormClosed += frmbill_FormClosed;
                frmbill.ShowDialog();
            }

            if (Action == "Delete")
            {
                try
                {
                    var messageBoxResult = MessageBox.Show("Are you sure want to delete this record?", "Delete", MessageBoxButtons.YesNo);
                    if (messageBoxResult == DialogResult.Yes)
                    {
                        var result = BillBusinessLogic.Delete(Convert.ToInt32(gridViewBill.Rows[e.RowIndex].Cells[0].Value));
                        MessageBox.Show("Bill deleted successfully.");
                        FillGridData();
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Bill already used some where else can't deleted successfully.");
                }
            }
        }
示例#2
0
        public JsonResult DeleteBillEntry(int srNo, int billId, int billOrderId)
        {
            var result = false;

            if (billId == 0)
            {
                var billEntryList = (List <tblBillEntryDTO>)Session["BillEntrySession"];
                if (billEntryList == null)
                {
                    billEntryList = new List <tblBillEntryDTO>();
                }
                var billEntry = billEntryList.Where(be => be.SrNo == srNo).FirstOrDefault();
                billEntryList.Remove(billEntry);
                Session["BillEntrySession"] = SetBillEntrySrNo(billEntryList);
                result = true;
            }
            else
            {
                result = BillBusinessLogic.DeleteBillEntry(billOrderId);
            }
            if (result)
            {
                return(Json(new { Success = true, Message = "Delete Successfully." }));
            }
            return(Json(new { Success = false, Message = "Error in transaction." }));
        }
示例#3
0
 public JsonResult BillEntryPartial(tblBillEntryDTO tblBillEntryDTO)
 {
     if (tblBillEntryDTO.BillId == 0)
     {
         var billEntryList = (List <tblBillEntryDTO>)Session["BillEntrySession"];
         if (billEntryList == null)
         {
             billEntryList = new List <tblBillEntryDTO>();
         }
         if (tblBillEntryDTO.SrNo == 0)
         {
             billEntryList.Add(tblBillEntryDTO);
         }
         else
         {
             var billEntry = billEntryList.Where(be => be.SrNo == tblBillEntryDTO.SrNo).FirstOrDefault();
             billEntry.BillId           = tblBillEntryDTO.BillId;
             billEntry.BookingOldBrCode = tblBillEntryDTO.BookingOldBrCode;
             billEntry.OldBillNo        = tblBillEntryDTO.OldBillNo;
             billEntry.OldBillDate      = tblBillEntryDTO.OldBillDate;
             billEntry.DestnCode        = tblBillEntryDTO.DestnCode;
             billEntry.Particulars      = tblBillEntryDTO.Particulars;
             billEntry.ChargedWeight    = tblBillEntryDTO.ChargedWeight;
             billEntry.Rate             = tblBillEntryDTO.Rate;
             billEntry.Amount           = tblBillEntryDTO.Amount;
         }
         Session["BillEntrySession"] = SetBillEntrySrNo(billEntryList);
     }
     else
     {
         BillBusinessLogic.SaveBillEntry(tblBillEntryDTO);
     }
     return(Json(new { Success = true, Message = "" }));
 }
示例#4
0
        public PartialViewResult BillEntryPartial(int srNO, int billId, int billOrderId)
        {
            var tblBillEntryDTO = new tblBillEntryDTO();

            if (billId == 0)
            {
                if (srNO > 0)
                {
                    var billEntryList = (List <tblBillEntryDTO>)Session["BillEntrySession"];
                    if (billEntryList == null)
                    {
                        billEntryList = new List <tblBillEntryDTO>();
                    }
                    tblBillEntryDTO = billEntryList.Where(be => be.SrNo == srNO).FirstOrDefault();
                }
            }
            else
            {
                if (billOrderId > 0)
                {
                    tblBillEntryDTO = BillBusinessLogic.GetBillEntry(billOrderId);
                }
            }
            return(PartialView(tblBillEntryDTO));
        }
示例#5
0
 void frmEntryBill_Load(object sender, EventArgs e)
 {
     FillDropDown();
     if (BillId > 0)
     {
         var bill = BillBusinessLogic.Get(BillId); ;
         textbillno.Text = Convert.ToString(bill.BillNo);
         dateTimebilldate.Text = Convert.ToString(bill.BillDateString);
         cmbParty.SelectedItem = Convert.ToString(bill.PartyId);
         textbranchcode.Text = bill.BranchCode;
         dateTimeduedate.Text = Convert.ToString(bill.PaymentDueDateString);
         combotickbill.SelectedItem = bill.BillType;
         textbasicofchange.Text = bill.BasicOfChargesGC;
         textenclosure.Text = bill.Enclosure;
         comboservicetax.SelectedItem = bill.ServiceTaxThrough;
         textcheckedby.Text = bill.CheckedBy;
         texttaxregdno.Text = bill.ServiceTaxThrough;
         textservicetax.Text = bill.ServiceTaxRegdNo;
         int i = 1;
         foreach (var item in bill.BillEntryList)
         {
             item.SrNo = i++;
             CommonClass.tblBillEntryDTO.Add(item);
         }
         fillGridData();
     }
     else
     {
         textbillno.Text = Convert.ToString(BillBusinessLogic.GetBillNo() + 1);
     }
 }
示例#6
0
        public JsonResult DeleteBill(int billId)
        {
            var result = BillBusinessLogic.Delete(billId);

            if (result)
            {
                return(Json(new { Success = true, Message = "Delete Successfully." }));
            }
            return(Json(new { Success = false, Message = "Error in transaction." }));
        }
示例#7
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            if (validatedata())
            {
                if (CommonClass.tblBillEntryDTO.Count() == 0)
                {
                    MessageBox.Show("Enter Atlease On Bill Entry");
                    return;
                }

                var resultDuplicateBllNo = BillBusinessLogic.CheckDuplicateBillNo(BillId, Convert.ToInt32(textbillno.Text));
                if (resultDuplicateBllNo)
                {
                    MessageBox.Show("Bill no already exists.");
                }
                else
                {

                    tblBillDTO tblbilldto = new tblBillDTO();
                    if (BillId > 0)
                        tblbilldto.BillId = BillId;
                    tblbilldto.BillNo = Convert.ToInt32(textbillno.Text);
                    tblbilldto.BillDate = Convert.ToDateTime(dateTimebilldate.Text);
                    tblbilldto.PartyId = Convert.ToInt32(cmbParty.SelectedValue);
                    tblbilldto.BranchCode = textbranchcode.Text;
                    tblbilldto.PaymentDueDate = Convert.ToDateTime(dateTimeduedate.Text);
                    tblbilldto.BillType = Convert.ToString(combotickbill.SelectedItem);
                    tblbilldto.BasicOfChargesGC = textbasicofchange.Text;
                    tblbilldto.Enclosure = textenclosure.Text;
                    tblbilldto.ServiceTaxThrough = Convert.ToString(comboservicetax.SelectedItem);
                    tblbilldto.CheckedBy = textcheckedby.Text;
                    tblbilldto.GrandTotal = Convert.ToInt32(CommonClass.tblBillEntryDTO.Sum(h => h.Amount));
                    tblbilldto.ServiceTaxRegdNo = textservicetax.Text;
                    tblbilldto.BillEntryList = CommonClass.tblBillEntryDTO;
                    var result = BillBusinessLogic.Save(tblbilldto);
                    if (result > 0)
                    {
                        MessageBox.Show("Bill Succussfully Generate");
                        if (BillId != 0)
                        {
                            this.Close();
                        }
                        else
                        {
                            CleanData();
                        }
                    }
                    else
                    {
                        MessageBox.Show("Bill Generation Fail Dua to some Problem");
                    }
                }
            }

        }
 public MainForm()
 {
     InitializeComponent();
     _supplierBusinessLogic    = new SupplierBusinessLogic();
     _productBusinessLogic     = new ProductBusinessLogic();
     _userBusinessLogic        = new UserBusinessLogic();
     _billBusinessLogic        = new BillBusinessLogic();
     _shipperBusinessLogic     = new ShipperBussinessLogic();
     _productTypeBusinessLogic = new ProductTypeBusinessLogic();
     _importBusinessLogic      = new ImportBusinessLogic();
 }
示例#9
0
        public ActionResult _AjaxGetBills()
        {
            var bills = BillBusinessLogic.GetAll();

            foreach (var item in bills)
            {
                item.BillDateString       = ((DateTime)item.BillDate).ToString("dd-MM-yyyy");
                item.PaymentDueDateString = ((DateTime)item.PaymentDueDate).ToString("dd-MM-yyyy");
            }
            return(View(new GridModel(bills)));
        }
示例#10
0
        public ActionResult Save(int id)
        {
            tblBillDTO tblBillDTO = new tblBillDTO();

            if (id == 0)
            {
                tblBillDTO        = new tblBillDTO();
                tblBillDTO.BillNo = BillBusinessLogic.GetBillNo() + 1;
            }
            else
            {
                tblBillDTO = BillBusinessLogic.Get(id);
            }
            tblBillDTO = FillDropDown(tblBillDTO);
            return(View(tblBillDTO));
        }
        public BillDetailForm(int?BillId = null, int?CusId = null, int?ShipperId = null)
        {
            InitializeComponent();
            _billBusinessLogic            = new BillBusinessLogic();
            _billDetailBusinessLogicLayer = new BillDetailBusinessLogicLayer();
            _shipperBussinessLogic        = new ShipperBussinessLogic();
            _userBusinessLogic            = new UserBusinessLogic();
            _productBusinessLogic         = new ProductBusinessLogic();

            if (BillId == null || CusId == null || ShipperId == null)
            {
                return;
            }
            _BillId    = (int)BillId;
            _CusId     = (int)CusId;
            _ShipperId = (int)ShipperId;

            btn_UpdateNote.Enabled           = false;
            btn_UpdateShipperForBill.Enabled = false;
            rTxtB_Note.Enabled = false;

            bill                 = _billBusinessLogic.GetBillById(_BillId);
            txtB_BillId.Text     = bill.Id.ToString();
            txtB_BillStatus.Text = bill.Status;
            txtB_DateOrder.Text  = bill.DateOrder.ToString();
            txtB_TotalMoney.Text = bill.Total.ToString();
            txtB_Addr.Text       = bill.Addr;
            txtB_Dis.Text        = bill.Dis;
            txtB_city.Text       = bill.City;
            rTxtB_Note.Text      = bill.Note;

            customer          = _userBusinessLogic.GetDetailUser(_CusId);
            txtB_NameCus.Text = customer.Name;

            GridView_BillDetails.DataSource = _billDetailBusinessLogicLayer.GetBillDetailsByBillId(_BillId);


            if (_ShipperId == 0)
            {
                return;
            }

            shipper = _shipperBussinessLogic.GetDetailShipper(_ShipperId);
            txtB_ShiperName.Text   = shipper.Name;
            txtB_ShipperEmail.Text = shipper.Email;
            txtB_ShipperPhone.Text = shipper.Phone;
        }
示例#12
0
        public ActionResult _AjaxGetBillEntrys(int billId)
        {
            List <tblBillEntryDTO> billEntryList = new List <tblBillEntryDTO>();

            if (billId == 0)
            {
                billEntryList = (List <tblBillEntryDTO>)Session["BillEntrySession"];
                if (billEntryList == null)
                {
                    billEntryList = new List <tblBillEntryDTO>();
                }
            }
            else
            {
                billEntryList = BillBusinessLogic.GetBillEntryList(billId);
            }
            return(View(new GridModel(SetBillEntrySrNo(billEntryList))));
        }
示例#13
0
        private void CleanData()
        {
            textbillno.Text = "";
            dateTimebilldate.Text = "";
            cmbParty.SelectedValue = "";
            textbranchcode.Text = "";
            dateTimeduedate.Text = "";
            combotickbill.SelectedItem = "";
            textbasicofchange.Text = "";
            textenclosure.Text = "";
            comboservicetax.SelectedItem = "";
            textcheckedby.Text = "";
            textservicetax.Text = "";
            CommonClass.tblBillEntryDTO.Clear();
            grdEntryBill.DataSource = null;
            textbillno.Text = Convert.ToString(BillBusinessLogic.GetBillNo() + 1);
            cmbParty.Focus();

        }
示例#14
0
 public ActionResult Save(tblBillDTO tblBillDTO)
 {
     if (ModelState.IsValid)
     {
         var resultDuplicateBllNo = BillBusinessLogic.CheckDuplicateBillNo(tblBillDTO.BillId, tblBillDTO.BillNo);
         if (resultDuplicateBllNo)
         {
             ModelState.AddModelError("BillNo", "Bill no already exists.");
         }
         else
         {
             if (tblBillDTO.BillId == 0)
             {
                 tblBillDTO.BillEntryList = (List <tblBillEntryDTO>)Session["BillEntrySession"];
             }
             var result = BillBusinessLogic.Save(tblBillDTO);
             return(RedirectToAction("Index"));
         }
     }
     tblBillDTO = FillDropDown(tblBillDTO);
     return(View(tblBillDTO));
 }