Exemplo n.º 1
0
        public ActionResult Index()
        {
            SuppliersBL      objsupplierBl = new SuppliersBL();
            List <Suppliers> suppliersList = objsupplierBl.GetSuppliersList();

            return(View(suppliersList));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            BankBL objBankBL = new BankBL();

            lstBank = objBankBL.GetAllBanks(cnt).ToList();

            SuppliersBL objSuppliersBL = new SuppliersBL();

            lstSuppliers = objSuppliersBL.GetAllSuppliers(cntt).ToList();

            MajorAccountBL objMajorAccountBL = new MajorAccountBL();

            lstMajor = objMajorAccountBL.GetAllAccounts(mt).ToList();

            MinorAccountBL objMinorAccountBL = new MinorAccountBL();

            lstMinor = objMinorAccountBL.GetAllMinorAccount(nt).ToList();

            if (!IsPostBack)
            {
                if (Session["PaymentID"].ToString() != null)
                {
                    int PaymentID = Convert.ToInt32(Session["PaymentID"]);
                    GetPaymentsByID(PaymentID);
                }
            }
        }
Exemplo n.º 3
0
        public ActionResult Edit(int id)
        {
            SuppliersBL supplierBL = new SuppliersBL();
            var         supplier   = supplierBL.GetSupplierById(id);

            return(View(supplier));
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SuppliersBL objSuppliersBL = new SuppliersBL();

            lstSuppliers = objSuppliersBL.GetAllSuppliers(cntt).ToList();

            if (!IsPostBack)
            {
                GetPayments();
            }
        }
        protected string GetSuppliers(int spid)
        {
            List <Supplierstbl> lstSuppliers   = new List <Supplierstbl>();
            Supplierstbl        sps            = new Supplierstbl();
            SuppliersBL         objSuppliersBL = new SuppliersBL();

            lstSuppliers = objSuppliersBL.GetAllSuppliers(sps).ToList();
            var supplier = lstSuppliers.OfType <Supplierstbl>().Where(a => a.SupplierID == spid);

            //return supplier.First().AgencyName;
            return(supplier.Count() > 0 ? supplier.First().Supplier : "");
        }
Exemplo n.º 6
0
        public ActionResult Delete(int id)
        {
            SuppliersBL  supplierBL = new SuppliersBL();
            ReturnResult result     = supplierBL.DeleteSupplier(id);

            if (!result.IsSuccess)
            {
                TempData["Message"] = "Error while deleting supplier.";
            }

            return(RedirectToAction("Index"));
            //return View();
        }
Exemplo n.º 7
0
        //protected string GetSuppliers(int spid)
        //{
        //    List<Supplierstbl> lstSuppliers = new List<Supplierstbl>();
        //    Supplierstbl sps = new Supplierstbl();
        //    SuppliersBL objSuppliersBL = new SuppliersBL();
        //    lstSuppliers = objSuppliersBL.GetAllSuppliers(sps).ToList();
        //    var supplier = lstSuppliers.OfType<Supplierstbl>().Where(a => a.SupplierID == spid);
        //    return supplier.First().AgencyName;
        //}

        protected string GetSuppliers()
        {
            List <Supplierstbl> lstSuppliers   = new List <Supplierstbl>();
            Supplierstbl        sps            = new Supplierstbl();
            SuppliersBL         objSuppliersBL = new SuppliersBL();

            lstSuppliers = objSuppliersBL.GetAllSuppliers(sps).ToList();

            foreach (var cnt in lstSuppliers)
            {
                sps.Supplier = cnt.Supplier;
            }

            return(sps.Supplier);
        }
        protected void GetSupplier()
        {
            List <Supplierstbl> lstSupplier = new List <Supplierstbl>();
            Supplierstbl        sup         = new Supplierstbl();
            SuppliersBL         objsupBL    = new SuppliersBL();

            sup.IsActive = 1;
            lstSupplier  = objsupBL.GetSuppliersByStatus(sup).ToList();
            foreach (var cnt in lstSupplier)
            {
                ListItem li = new ListItem();
                li.Text  = cnt.Supplier;
                li.Value = cnt.SupplierID.ToString();
                ddlSupplierID.Items.Add(li);
            }
        }
Exemplo n.º 9
0
        public ActionResult Edit(int id, FormCollection collection)
        {
            ReturnResult returnResult = new ReturnResult();
            Suppliers    objSupplier  = new Suppliers();

            try
            {
                // Just to check the error log
                //int a = 0, b=1,c;
                //c = b / a;


                SuppliersBL supplierBL = new SuppliersBL();
                objSupplier.SupplierId   = id;
                objSupplier.SupplierCode = Convert.ToString(collection["SupplierCode"]);
                objSupplier.SupplierName = Convert.ToString(collection["SupplierName"]);
                objSupplier.Address      = Convert.ToString(collection["Address"]);
                objSupplier.City         = Convert.ToString(collection["City"]);
                objSupplier.ContactEmail = Convert.ToString(collection["ContactEmail"]);
                objSupplier.ContactName  = Convert.ToString(collection["ContactName"]);
                objSupplier.ContactTitle = Convert.ToString(collection["ContactTitle"]);
                objSupplier.Country      = Convert.ToString(collection["Country"]);
                objSupplier.Fax          = Convert.ToString(collection["Fax"]);
                objSupplier.Phone1       = Convert.ToString(collection["Phone1"]);
                objSupplier.Phone2       = Convert.ToString(collection["Phone2"]);
                objSupplier.PostalCode   = Convert.ToString(collection["PostalCode"]);
                objSupplier.Website      = Convert.ToString(collection["Website"]);
                returnResult             = supplierBL.SaveSupplier(objSupplier);


                if (returnResult.IsSuccess)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    TempData["UpdateSupplierMessage"] = returnResult.Message;
                    return(View(objSupplier));
                }
            }
            catch (Exception ex)
            {
                Logger.Error("IBS.ERP.SupplierController.Edit [HttpPost] ID: " + id, ex);
                TempData["UpdateSupplierMessage"] = returnResult.Message;
                return(View(objSupplier));
            }
        }
Exemplo n.º 10
0
        public ActionResult Create(FormCollection collection)
        {
            ReturnResult returnResult = new ReturnResult();
            Suppliers    objSupplier  = new Suppliers();

            try
            {
                // TODO: Add insert logic here

                SuppliersBL suppplierBL = new SuppliersBL();
                objSupplier.SupplierId   = 0;
                objSupplier.SupplierCode = Convert.ToString(collection["SupplierCode"]);
                objSupplier.SupplierName = Convert.ToString(collection["SupplierName"]);
                objSupplier.Address      = Convert.ToString(collection["Address"]);
                objSupplier.City         = Convert.ToString(collection["City"]);
                objSupplier.ContactEmail = Convert.ToString(collection["ContactEmail"]);
                objSupplier.ContactName  = Convert.ToString(collection["ContactName"]);
                objSupplier.ContactTitle = Convert.ToString(collection["ContactTitle"]);
                objSupplier.Country      = Convert.ToString(collection["Country"]);
                objSupplier.Fax          = Convert.ToString(collection["Fax"]);
                objSupplier.Phone1       = Convert.ToString(collection["Phone1"]);
                objSupplier.Phone2       = Convert.ToString(collection["Phone2"]);
                objSupplier.PostalCode   = Convert.ToString(collection["PostalCode"]);
                objSupplier.Website      = Convert.ToString(collection["Website"]);

                returnResult = suppplierBL.SaveSupplier(objSupplier);
                if (returnResult.IsSuccess)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    TempData["CreateSupplierMessage"] = returnResult.Message;
                    return(View(objSupplier));
                }
            }
            catch (Exception ex)
            {
                Logger.Error("IBS.ERP.SupplierController.Create [HttpPost] ID:0 ", ex);
                TempData["CreateSupplierMessage"] = returnResult.Message;
                return(View(objSupplier));
            }
        }
Exemplo n.º 11
0
        //protected void GetEmployee()
        //{
        //    List<Employeetbl> lstEmployee = new List<Employeetbl>();
        //    Employeetbl epy = new Employeetbl();
        //    EmployeeBL objEmployeeBL = new EmployeeBL();
        //    //bks.Status = 1.ToString();
        //    lstEmployee = objEmployeeBL.GetAllEmployee(epy).ToList();
        //    ListItem e = new ListItem();
        //    e.Text = "--Select--";
        //    e.Value = 0.ToString();
        //    ddlStaff.Items.Add(e);
        //    foreach (var ept in lstEmployee)
        //    {
        //        ListItem ep = new ListItem();
        //        ep.Text = ept.FirstName + " " + ept.LastName;
        //        ep.Value = ept.EmpId.ToString();
        //        ddlStaff.Items.Add(ep);
        //    }
        //}

        protected void GetSuppliers()
        {
            List<Supplierstbl> lstSuppliers = new List<Supplierstbl>();
            Supplierstbl sps = new Supplierstbl();
            SuppliersBL objSuppliersBL = new SuppliersBL();
            //bks.Status = 1.ToString();
            lstSuppliers = objSuppliersBL.GetAllSuppliers(sps).ToList();
            ListItem s = new ListItem();
            s.Text = "--Select--";
            s.Value = 0.ToString();
            ddlStaff.Items.Add(s);
            foreach (var spt in lstSuppliers)
            {
                ListItem sp = new ListItem();
                sp.Text = spt.Supplier;
                sp.Value = spt.SupplierID.ToString();
                ddlStaff.Items.Add(sp);
            }
        }
        protected void GetSuppliers()
        {
            List <Supplierstbl> lstSuppliers   = new List <Supplierstbl>();
            Supplierstbl        sup            = new Supplierstbl();
            SuppliersBL         objSuppliersBL = new SuppliersBL();

            sup.IsActive = 1;
            lstSuppliers = objSuppliersBL.GetSuppliersByStatus(sup).ToList();
            ddlToAccount.Items.Clear();
            ListItem m = new ListItem();

            m.Text  = "--Select--";
            m.Value = 0.ToString();
            ddlToAccount.Items.Add(m);
            foreach (var cntt in lstSuppliers)
            {
                ListItem la = new ListItem();
                la.Text  = cntt.Supplier;
                la.Value = cntt.SupplierID.ToString();
                ddlToAccount.Items.Add(la);
            }
        }
Exemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AgentsBL objAgentsBL = new AgentsBL();
            lstAgents = objAgentsBL.GetAllAgents(cntt).ToList();

            BookingDetailsBL objBookingDetailsBL = new BookingDetailsBL();
            lstBookings = objBookingDetailsBL.GetAllBooking(bdt).ToList();

            //EmployeeBL objEmployeeBL = new EmployeeBL();
            //lstEmployee = objEmployeeBL.GetAllEmployee(ept).ToList();

            SuppliersBL objSuppliersBL = new SuppliersBL();
            lstSuppliers = objSuppliersBL.GetAllSuppliers(spt).ToList();

            if (!IsPostBack)
            {
                GetAllBookings();
                GetAgents();
                GetBookingDetails();
                //GetEmployee();
                GetSuppliers();
            }
        }
Exemplo n.º 14
0
        protected string GetSuppliers(int spid)
        {
            List <Supplierstbl> lstSuppliers   = new List <Supplierstbl>();
            Supplierstbl        sps            = new Supplierstbl();
            SuppliersBL         objSuppliersBL = new SuppliersBL();

            sps.IsActive = 1;
            lstSuppliers = objSuppliersBL.GetSuppliersByStatus(sps).ToList();
            ListItem l = new ListItem();

            l.Text  = "--Select--";
            l.Value = 0.ToString();
            ddlToAccount.Items.Add(l);
            foreach (var cnt in lstSuppliers)
            {
                ListItem li = new ListItem();
                li.Text  = cnt.Supplier;
                li.Value = cnt.SupplierID.ToString();
                ddlToAccount.Items.Add(li);
            }
            var suppliers = lstSuppliers.OfType <Supplierstbl>().Where(a => a.SupplierID == spid);

            return(suppliers.Count() > 0 ? suppliers.First().Supplier : "");
        }
Exemplo n.º 15
0
        public static DataTable GetSuppliers()
        {
            SuppliersBL SuppliersBL = new SuppliersBL();

            return(SuppliersBL.GetSuppliers());
        }
Exemplo n.º 16
0
        public static FASM_Enums.InfoMessages SaveSuppliers(ref Suppliers eSuppliers)
        {
            SuppliersBL SuppliersBL = new SuppliersBL();

            return(SuppliersBL.SaveSuppliers(ref eSuppliers));
        }
Exemplo n.º 17
0
        public static FASM_Enums.InfoMessages DeleteSuppliers(Int64 SupplierId)
        {
            SuppliersBL SuppliersBL = new SuppliersBL();

            return(SuppliersBL.DeleteSuppliers(SupplierId));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            BankBL objBankBL = new BankBL();

            lstBank = objBankBL.GetAllBanks(cnt).ToList();

            SuppliersBL objSuppliersBL = new SuppliersBL();

            lstSuppliers = objSuppliersBL.GetAllSuppliers(cntt).ToList();

            MajorAccountBL objMajorAccountBL = new MajorAccountBL();

            lstMajor = objMajorAccountBL.GetAllAccounts(mt).ToList();

            MinorAccountBL objMinorAccountBL = new MinorAccountBL();

            lstMinor = objMinorAccountBL.GetAllMinorAccount(nt).ToList();

            if (!IsPostBack)
            {
                divPM.Visible     = false;
                divCheque.Visible = false;
                divDD.Visible     = false;
                divBank.Visible   = false;
                divCard.Visible   = false;
                divTD.Visible     = false;
                divRN.Visible     = false;

                //divCheque.Attributes.Remove("class");
                //divDD.Attributes.Remove("class");
                //divBank.Attributes.Remove("class");
                //divCard.Attributes.Remove("class");
                //divTD.Attributes.Remove("class");
                //divRN.Attributes.Remove("class");

                lblPaymentMode.Visible     = false;
                ddlPaymentMode.Visible     = false;
                lblChequeNo.Visible        = false;
                txtChequeNo.Visible        = false;
                lblChequeDate.Visible      = false;
                txtChequeDate.Visible      = false;
                lblAcNO.Visible            = false;
                txtAcNo.Visible            = false;
                lblDDNo.Visible            = false;
                txtDDNo.Visible            = false;
                lblDDDate.Visible          = false;
                txtDDDate.Visible          = false;
                lblBankName.Visible        = false;
                txtBankName.Visible        = false;
                lblCardNo.Visible          = false;
                txtCardNo.Visible          = false;
                lblTransactionDate.Visible = false;
                txtTransactionDate.Visible = false;
                lblReferenceNo.Visible     = false;
                txtReferenceNo.Visible     = false;
                Random rnd = new Random();
                int    num = rnd.Next(10000);
                txtVoucherNumber.Text = "MFB" + num;

                GetSuppliers();
                GetMajorAccounts();
                GetMinorAccounts();
            }
        }
Exemplo n.º 19
0
        public static void LoadSuppliers(ref Suppliers eSuppliers)
        {
            SuppliersBL SuppliersBL = new SuppliersBL();

            SuppliersBL.LoadSuppliers(ref eSuppliers);
        }