コード例 #1
0
ファイル: ReportViewer.aspx.cs プロジェクト: sajidur/erp
        private void LedgerReport()
        {
            string type       = Request.QueryString["type"].ToString();
            string ledgerId   = Request.QueryString["ledgerId"].ToString();
            string isSupplier = Request.QueryString["IsSupplier"];
            string fromDate   = Request.QueryString["fromDate"].ToString();
            string toDate     = Request.QueryString["toDate"].ToString();
            var    yearId     = CurrentSession.GetCurrentSession().FinancialYear;
            string query      = @"exec rptCustomerLedger '" + ledgerId + "'," + type + "," + yearId + ",'" + fromDate + "','" + toDate + "'";

            oResult = oDAL.Select(query);
            DataSet dt = null;

            dt = oResult.ds as DataSet;
            ReportViewer1.ProcessingMode         = ProcessingMode.Local;
            ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Report/RPT/rptCustomerLedger.rdlc");
            ReportDataSource datasource = new ReportDataSource("CustomerLedger", dt.Tables[0]);

            ReportViewer1.LocalReport.DataSources.Clear();
            ReportViewer1.LocalReport.DataSources.Add(datasource);


            query   = @"exec GetCustomerBalance " + ledgerId + "";
            oResult = oDAL.Select(query);
            dt      = oResult.ds as DataSet;
            ReportDataSource customerDatasource = new ReportDataSource("CustomerBalance", dt.Tables[0]);

            ReportViewer1.LocalReport.DataSources.Add(customerDatasource);

            ReportViewer1.ZoomMode = Microsoft.Reporting.WebForms.ZoomMode.PageWidth;
        }
コード例 #2
0
        public ActionResult Create(Employee employee)
        {
            var result = employee;

            if (ModelState.IsValid)
            {
                employee.CreationDate = DateTime.Now;
                employee.Creator      = CurrentSession.GetCurrentSession().UserName;
                employee.IsActive     = true;
                employee.Photo        = ImageViewModel.bufferByte;
                AccountLedger ledger = new AccountLedger();
                ledger.AccountGroupId    = 1;
                ledger.Address           = employee.Address;
                ledger.BankAccountNumber = "";
                ledger.BillByBill        = true;
                ledger.BranchCode        = "";
                ledger.BranchName        = "";
                ledger.CreditLimit       = 0.0m;
                ledger.CreditPeriod      = 1;
                ledger.CrOrDr            = "Dr";
                ledger.Email             = employee.Email;
                ledger.IsDefault         = false;
                ledger.LedgerName        = employee.Code + "-" + employee.FirstName;
                ledger.Mobile            = employee.Phone;
                ledger.OpeningBalance    = 0.0m;
                // var saved = Accounts.Save(ledger);
                //  employee.LedgerId = saved.Id;
                result = db.Save(employee);
            }

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
ファイル: PartyBalanceService.cs プロジェクト: sajidur/erp
        public List <DueSummaryResponse> GetDueSummary(int reportType)
        {
            List <SqlParameter> parameters = new List <SqlParameter>();
            var get = dueSummaryService.ExecuteProcedure("Exec DueSummary '" + CurrentSession.GetCurrentSession().FinancialYear + "','" + reportType + "'," + yearId + "");

            return(get);
        }
コード例 #4
0
        public ActionResult Index()
        {
            LoginService service     = new LoginService();
            var          currentUser = CurrentSession.GetCurrentSession();

            if (currentUser != null)
            {
                List <MenuPermission> list = new List <MenuPermission>();
                var ListOfPermittedMenu    = service.GetMenuPermission(currentUser.UserRoleId);
                var maninMenu = ListOfPermittedMenu.Where(a => a.ParentScreenId == "0000").ToList();

                foreach (var item in maninMenu)
                {
                    var menu = new MenuPermission();
                    menu.MainModule = item;
                    var submodule = ListOfPermittedMenu.Where(a => a.ParentScreenId == item.ScreenId).ToList();
                    menu.SubModules = submodule;
                    list.Add(menu);
                }
                Session["MenuPermission"] = list;
                return(View());
            }
            else
            {
                return(RedirectToAction("Index", "Login"));
            }
        }
コード例 #5
0
ファイル: SalesController.cs プロジェクト: sajidur/erp
        public ActionResult Delivery(int Id, string Notes)
        {
            var salesDetails  = this.salesService.GetBySalesDetailesId(Id);
            var salesDelivery = new SalesDelivery()
            {
                AdditionalCost = 0,
                CustomerID     = salesDetails.SalesMaster.CustomerID,
                IsActive       = true,
                DeliveryDate   = DateTime.Now,
                DriverMobileNo = "",
                DriverName     = "",
                ExpenseBy      = "",
                Notes          = Notes,
                SalesDetailsId = salesDetails.Id,
                SalesInvoice   = salesDetails.SalesInvoice,
                SalesMasterId  = salesDetails.SalesMasterId,
                TransportNo    = "",
                TransportType  = "",
                CreatedDate    = DateTime.Now,
                CreatedBy      = CurrentSession.GetCurrentSession().UserName
            };

            salesDeliveryService.Save(salesDelivery);
            salesDetails.DeliveryStatus = (int)DeliveryStatus.Delivered;
            salesDetails.Notes          = Notes;
            salesService.Update(salesDetails, Id);
            return(Json("Delivered Sucess", JsonRequestBehavior.AllowGet));
        }
コード例 #6
0
ファイル: SalesDeliveryService.cs プロジェクト: sajidur/erp
 public SalesDelivery Save(SalesDelivery cus)
 {
     cus.CreatedDate = DateTime.Now;
     cus.CreatedBy   = CurrentSession.GetCurrentSession().UserName;
     service.Save(cus);
     return(cus);
 }
コード例 #7
0
        public ActionResult Save(string InvoiceNo, string Notes, List <StockOut> stockOuts)
        {
            StockOut result      = new StockOut();
            StockOut FinalResult = new StockOut();

            //if (ModelState.IsValid)
            {
                foreach (var item in stockOuts)
                {
                    result.InvoiceNo      = InvoiceNo;
                    result.Notes          = Notes;
                    result.IsActive       = true;
                    result.CreatedDate    = DateTime.Now;
                    result.ProductionDate = DateTime.Now;
                    result.CreatedBy      = CurrentSession.GetCurrentSession().UserName;

                    result.ProductId   = item.ProductId;
                    result.BaleWeight  = item.BaleWeight;
                    result.WarehouseId = item.WarehouseId;
                    result.SupplierId  = item.SupplierId;
                    result.BaleQty     = item.BaleQty;
                    result.WeightInMon = item.WeightInMon;

                    FinalResult = service.Save(result);
                }
            }

            return(Json(FinalResult, JsonRequestBehavior.AllowGet));
        }
コード例 #8
0
        public LedgerPosting Save(LedgerPosting ledger)
        {
            var ledgerDetails = ledgerService.GetById(ledger.LedgerId);
            // var isExists = service.GetAll().Where(a => a.InvoiceNo == ledger.InvoiceNo && a.LedgerId == ledger.LedgerId).FirstOrDefault();
            var max = service.LastRow().OrderByDescending(a => a.Id).FirstOrDefault();

            if (max == null)
            {
                ledger.Id = 1;
            }
            else
            {
                ledger.Id = max.Id + 1;
            }

            if (ledger.VoucherNo == null)
            {
                ledger.VoucherNo = max.VoucherNo + 1;
            }
            ledger.YearId   = CurrentSession.GetCurrentSession().FinancialYear;
            ledger.IsActive = true;
            var result = service.Save(ledger);

            return(result);
        }
コード例 #9
0
        public StockIn Save(StockIn stockIn, string Notes)
        {
            var existingItem = inventory.GetAll(a => a.ProductId == stockIn.ProductId && a.IsActive == true && a.WarehouseId == stockIn.WarehouseId).ToList();

            if (existingItem.Count > 0)
            {
                foreach (var inv in existingItem)
                {
                    inv.UpdatedDate = DateTime.Now;
                    inv.UpdatedBy   = CurrentSession.GetCurrentSession().UserName;
                    inv.ReceiveQty  = stockIn.BaleQty;
                    inv.GoodsType   = "2";
                    inventory.Update(inv, inv.Id);
                }
            }
            else
            {
                Inventory result      = new Inventory();
                Inventory FinalResult = new Inventory();

                result.ProductId   = (int)stockIn.ProductId;
                result.QtyInBale   = (int?)stockIn.BaleWeight;
                result.SupplierId  = 1;
                result.WarehouseId = (int)stockIn.WarehouseId;
                result.ReceiveQty  = stockIn.BaleQty;
                result.Notes       = Notes;
                result.GoodsType   = "2";
                result.CreatedBy   = CurrentSession.GetCurrentSession().UserName;
                result.CreatedDate = DateTime.Now;
                result.IsActive    = true;

                FinalResult = inventory.Save(result);
            }
            return(service.Save(stockIn));
        }
        public ActionResult Edit(Customer model)
        {
            if (model == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Customer customer = db.GetById(model.Id);

            if (customer == null)
            {
                return(HttpNotFound());
            }

            var sesssion = CurrentSession.GetCurrentSession();

            if (sesssion != null)
            {
            }

            model.IsActive    = true;
            model.UpdatedDate = DateTime.Now;
            model.UpdatedBy   = CurrentSession.GetCurrentSession().UserName;
            db.Update(model, model.Id);
            return(Json("Updated", JsonRequestBehavior.AllowGet));
        }
コード例 #11
0
ファイル: BonusDeductionService.cs プロジェクト: sajidur/erp
 public BonusDeduction Save(BonusDeduction cus)
 {
     cus.CreatedDate = DateTime.Now;
     cus.CreatedBy   = CurrentSession.GetCurrentSession().UserId;
     service.Save(cus);
     return(cus);
 }
コード例 #12
0
ファイル: SalaryItemNewService.cs プロジェクト: sajidur/erp
 public PayHead Save(PayHead cus)
 {
     //cus.Active = true;
     cus.CreatedDate = DateTime.Now;
     cus.CreatedBy   = CurrentSession.GetCurrentSession().UserId;
     service.Save(cus);
     return(cus);
 }
コード例 #13
0
        public ActionResult ChangeFinancialYear(int newYearId)
        {
            var newSession = CurrentSession.GetCurrentSession();

            newSession.FinancialYear = newYearId;
            Session["Session"]       = newSession;
            return(Json("CHanged to" + newYearId, JsonRequestBehavior.AllowGet));
        }
コード例 #14
0
 public Brand Save(Brand cus)
 {
     cus.Active      = true;
     cus.CreatedDate = DateTime.Now;
     cus.CreatedBy   = CurrentSession.GetCurrentSession().UserName;
     service.Save(cus);
     return(cus);
 }
コード例 #15
0
ファイル: PartyBalanceService.cs プロジェクト: sajidur/erp
        public PartyBalanceService()
        {
            var session = CurrentSession.GetCurrentSession();

            if (session != null)
            {
                yearId = session.FinancialYear;
            }
        }
コード例 #16
0
        public ActionResult SaveForLocalMarket(string totalAmount, string PONo, int supplierId, string descriptions, int WarehouseId, DateTime dates, List <GoodsReceiveResponse> response, List <AdditionalCost> additionalCost)
        {
            string        ID     = "";
            ReceiveMaster master = new ReceiveMaster();

            master.InvoiceNoPaper = descriptions;
            master.InvoiceDate    = dates;
            master.InvoiceNo      = new GlobalClass().GetMaxIdWithPrfix("InvoiceNo", "8", "00000001", "ReceiveMaster", "GL");
            master.SupplierID     = supplierId;
            master.TotalAmount    = decimal.Parse(totalAmount);
            ID = master.InvoiceNo;
            master.MarketType = "Local";
            foreach (var item in response)
            {
                ReceiveDetail details = new ReceiveDetail();
                //details.Id = item.Id;
                details.ReceiveMasterId = master.Id;
                details.ProductId       = item.ProductId;
                details.WarehouseId     = item.WarehouseId;
                details.Qty             = item.Qty;
                details.Rate            = item.Rate;

                details.SD     = item.SDRate;
                details.Tax    = item.TaxRate;
                details.Amount = item.Amount;

                details.IsActive    = true;
                details.CreatedBy   = CurrentSession.GetCurrentSession().UserName;
                details.CreatedDate = DateTime.Now;
                master.ReceiveDetails.Add(details);
                // total += details.QTY??0 * details.RetailPrice??0;
            }
            master.RecieveFrom = CurrentSession.GetCurrentSession().UserName;
            if (additionalCost != null && additionalCost.Count > 0)
            {
                master.AdditionalCost = additionalCost.Select(a => a.Debit).Sum(a => a.Value);
            }
            else
            {
                master.AdditionalCost = 0;
            }
            master.GrandTotal    = master.TotalAmount + master.AdditionalCost - master.BillDiscount;
            master.IsActive      = true;
            master.SupplierID    = supplierId;
            master.Notes         = descriptions;
            master.MarketType    = "Local";
            master.TransportType = "Truck";
            master.TransportNo   = "1";
            master.CreatedBy     = CurrentSession.GetCurrentSession().UserName;
            master.CreatedDate   = DateTime.Now;

            var result = service.Save(master, WarehouseId, 3);

            //return Json(result.Id, JsonRequestBehavior.AllowGet);
            return(Json(new { result = true, Error = "Saved", ID = ID }, JsonRequestBehavior.AllowGet));
        }
コード例 #17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int yearId = CurrentSession.GetCurrentSession().FinancialYear;
         try
         {
             string reportType = Request.QueryString["ReportName"].ToString();
             if (reportType == "Mushak11")
             {
                 Mushak11();
             }
             if (reportType == "EXECLIPARTReport")
             {
                 // LoadEXECLIPARTReport();
             }
             if (reportType == "SalesInvoice")
             {
                 Mushak11();
             }
             if (reportType == "StockOutForProcessing")
             {
                 StockOutForProcessing();
             }
             if (reportType == "CustomerDue")
             {
                 LoadCustomerDueReport();
             }
             if (reportType == "SalesDescriptions")
             {
                 LoadSalesDescriptions();
             }
             if (reportType == "SuplierTransaction")
             {
                 SuplierTransaction(yearId);
             }
             if (reportType == "CustomerTransaction")
             {
                 CustomerTransaction();
             }
             if (reportType == "IncomeStatement")
             {
                 IncomeStatment();
             }
             if (reportType == "LedgerReport")
             {
                 LedgerReport();
             }
         }
         catch (Exception ex)
         {
             lblMsg.InnerHtml = ex.Message;
         }
     }
 }
コード例 #18
0
        public ActionResult Save(string totalAmount, string PONo, int supplierId, string descriptions, int WarehouseId, List <GoodsReceiveResponse> response)
        {
            string        ID     = "";
            ReceiveMaster master = new ReceiveMaster();

            master.InvoiceNoPaper = PONo;
            master.TotalAmount    = decimal.Parse(totalAmount);
            master.InvoiceNo      = new GlobalClass().GetMaxIdWithPrfix("InvoiceNo", "8", "00000001", "ReceiveMaster", "GR");
            master.SupplierID     = supplierId;
            ID = master.InvoiceNo;
            var total = 0.0m;

            foreach (var item in response)
            {
                ReceiveDetail details = new ReceiveDetail();
                //details.Id = item.Id;
                details.ReceiveMasterId = master.Id;
                details.ProductId       = item.ProductId;
                details.WarehouseId     = item.WarehouseId;
                details.TotalBale       = item.TotalBale;
                details.QtyInBale       = item.QtyInBale;

                details.WeightInKG  = item.WeightInKG;
                details.WeightType  = item.WeightType;
                details.WeightInMon = item.WeightInMon;
                details.Amount      = item.Amount;
                details.TotalAmount = item.TotalAmount;


                details.IsActive    = true;
                details.CreatedBy   = CurrentSession.GetCurrentSession().UserName;
                details.CreatedDate = DateTime.Now;
                master.ReceiveDetails.Add(details);
                // total += details.QTY??0 * details.RetailPrice??0;
            }
            master.RecieveFrom    = CurrentSession.GetCurrentSession().UserName;
            master.AdditionalCost = 0.0m;
            master.BillDiscount   = 0.0m;
            //master.TotalAmount = total;
            master.GrandTotal    = master.TotalAmount + master.AdditionalCost - master.BillDiscount;
            master.InvoiceDate   = DateTime.Now;
            master.IsActive      = true;
            master.SupplierID    = supplierId;
            master.Notes         = descriptions;
            master.MarketType    = "Not Local";
            master.TransportType = "Truck";
            master.TransportNo   = "1";
            master.CreatedBy     = CurrentSession.GetCurrentSession().UserName;
            master.CreatedDate   = DateTime.Now;

            var result = service.Save(master, WarehouseId, 1);

            //return Json(result.Id, JsonRequestBehavior.AllowGet);
            return(Json(new { result = true, Error = "Saved", ID = ID }, JsonRequestBehavior.AllowGet));
        }
コード例 #19
0
        public rptIndividualLedger_Result GetBalance(int ledgerId)
        {
            SqlParameter        param   = new SqlParameter("@ledgerId", ledgerId);
            List <SqlParameter> paramss = new List <SqlParameter>();

            paramss.Add(param);
            SqlParameter param2 = new SqlParameter("@yearId", CurrentSession.GetCurrentSession().FinancialYear);

            paramss.Add(param2);
            return(balanceService.ExecuteProcedure("EXEC GetBalance @ledgerId,@yearId", paramss).FirstOrDefault());
        }
コード例 #20
0
ファイル: SalaryItemNewService.cs プロジェクト: sajidur/erp
 public SalaryPackage PackageSave(SalaryPackage cus)
 {
     //cus.Active = true;
     cus.CreateDate = DateTime.Now;
     cus.CreateBy   = CurrentSession.GetCurrentSession().UserName;
     foreach (var item in cus.SalaryPackageDetails)
     {
         item.SalaryPackageId = cus.Id;
     }
     _salaryPackageservice.Save(cus);
     return(cus);
 }
コード例 #21
0
ファイル: SalesController.cs プロジェクト: sajidur/erp
        public ActionResult SaveSalesOrder(List <SalesOrderRequest> salesOrders, int CustomerID, string SalesOrderId, string Notes, bool isSendSMS)
        {
            SalesOrder result      = new SalesOrder();
            SalesOrder FinalResult = new SalesOrder();
            decimal    totalAmount = new decimal();
            int        count       = 1;

            foreach (SalesOrderRequest item in salesOrders)
            {
                result.SalesOrderId   = SalesOrderId;
                result.CustomerID     = CustomerID;
                result.Notes          = Notes;
                result.OrderDate      = DateTime.Now.Date;
                result.OrderRecieveBy = CurrentSession.GetCurrentSession().UserName;
                result.ProductId      = item.Inventory.ProductId;
                result.BaleQty        = item.Qty;
                result.Rate           = item.Qty;
                result.SizeId         = item.Inventory.SizeId;
                result.BrandId        = item.Inventory.BrandId;
                //  result.Amount = item.Amount;
                result.InventoryId  = item.Inventory.Id;
                result.DeliveryDate = DateTime.Now;
                result.DeliveryQty  = new decimal?(new decimal());
                result.CreatedBy    = CurrentSession.GetCurrentSession().UserName;
                result.CreatedDate  = new DateTime?(DateTime.Now);
                result.IsActive     = true;
                FinalResult         = this.salesService.SaveSalesOrder(result);
                totalAmount        += result.Amount;
                count++;
            }
            if (FinalResult.Id > 0)
            {
                if (isSendSMS)
                {
                    Customer        customer        = (new CustomerService()).GetById(new int?(CustomerID));
                    SMSEmailService sMSEmailService = new SMSEmailService();
                    string          phone           = customer.Phone;
                    string[]        name            = new string[] { "Dear ", customer.Name, ",DO Has Been Created.DO No-", FinalResult.SalesOrderId, ", Dated- ", null, null, null, null };
                    name[5] = DateTime.Now.ToString("dd-MM-yyyy");
                    name[6] = ". Total DO Amount =";
                    name[7] = string.Format("{0:#,##0}", decimal.Round(totalAmount), "");
                    name[8] = "/= Dada Rice.";
                    var sendSMS = false;
                    if (sendSMS)
                    {
                        sMSEmailService.SendOneToOneSingleSms(phone, string.Concat(name));
                    }
                }
            }
            return(Json(FinalResult, JsonRequestBehavior.AllowGet));
        }
コード例 #22
0
ファイル: PartyBalanceService.cs プロジェクト: sajidur/erp
        public PartyBalance Save(PartyBalance partyBalance)
        {
            var isExists = service.GetAll().Where(a => a.LedgerId == partyBalance.LedgerId).OrderByDescending(a => a.PartyBalanceId).FirstOrDefault();
            var max      = service.LastRow().OrderByDescending(a => a.PartyBalanceId).FirstOrDefault();

            if (max == null)
            {
                partyBalance.PartyBalanceId = 1;
            }
            else
            {
                partyBalance.PartyBalanceId = max.PartyBalanceId + 1;
            }

            if (isExists != null)
            {
                if (partyBalance.Credit > 0)
                {
                    var newbalance = isExists.Balance + partyBalance.Credit;
                    partyBalance.Balance = newbalance;
                }
                if (partyBalance.Debit > 0)
                {
                    var newbalance = isExists.Balance - partyBalance.Debit;
                    partyBalance.Balance = newbalance;
                }
            }
            else
            {
                if (partyBalance.Credit > 0)
                {
                    partyBalance.Balance = partyBalance.Credit;
                }
                if (partyBalance.Debit > 0)
                {
                    partyBalance.Balance = (-1) * partyBalance.Debit;
                }
            }
            partyBalance.FinancialYearId = CurrentSession.GetCurrentSession().FinancialYear;
            partyBalance.IsLastYear      = true;
            service.Save(partyBalance);
            //if (partyBalance != null)
            //{
            //    SqlParameter param = new SqlParameter("@LedgerId", partyBalance.LedgerId);
            //    List<SqlParameter> paramss = new List<SqlParameter>();

            //    paramss.Add(param);
            //    service.ExecuteProcedure("Exec BalanceReconcilation " + partyBalance.LedgerId + "",paramss,true);
            //}
            return(partyBalance);
        }
コード例 #23
0
ファイル: WareHouseController.cs プロジェクト: sajidur/erp
        public ActionResult Create(WareHouse oWareHouse, int create)
        {
            var result = oWareHouse;

            if (ModelState.IsValid)
            {
                oWareHouse.CreatedDate = DateTime.Now;
                oWareHouse.CreatedBy   = CurrentSession.GetCurrentSession().UserName;
                oWareHouse.IsActive    = true;
                result = db.Save(oWareHouse);
            }

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
コード例 #24
0
        public LedgerPosting Save(LedgerPosting cus)
        {
            var isExists = service.GetAll().Where(a => a.LedgerId == cus.LedgerId && a.YearId == cus.YearId).FirstOrDefault();
            var max      = service.LastRow().OrderByDescending(a => a.Id).FirstOrDefault().Id;

            cus.Id = max + 1;
            if (isExists != null)
            {
                return(null);
            }
            cus.YearId = CurrentSession.GetCurrentSession().FinancialYear;
            service.Save(cus);
            return(cus);
        }
        public ActionResult Create(Supplier supplier, int create)
        {
            var result = supplier;

            if (ModelState.IsValid)
            {
                supplier.CreationDate = DateTime.Now;
                supplier.UpdateDate   = DateTime.Now;
                supplier.Creator      = CurrentSession.GetCurrentSession().UserName;
                supplier.IsActive     = true;
                result = db.Save(supplier);
            }

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
コード例 #26
0
        public ActionResult Create(Product category, int create)
        {
            var result = category;

            if (ModelState.IsValid)
            {
                category.CreatedDate = DateTime.Now;
                category.UpdateDate  = DateTime.Now;
                category.CreatedBy   = CurrentSession.GetCurrentSession().UserName;
                category.IsActive    = true;
                result = db.Save(category);
            }

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
コード例 #27
0
        // GET: FinancialYear
        public ActionResult Index()
        {
            var categories    = year.GetAll().ToList();
            var financialyear = CurrentSession.GetCurrentSession();
            var model         = new FinancialYearView
            {
                SelectedYearId = financialyear.FinancialYear,
                FinancialYears = categories.Select(x => new SelectListItem
                {
                    Value = x.Id.ToString(),
                    Text  = x.Extra1
                })
            };

            return(PartialView("_FinancialYear", model));
        }
コード例 #28
0
        public StockOut Save(StockOut stockOut)
        {
            var existingItem = inventory.GetAll(a => a.ProductId == stockOut.ProductId && a.QtyInBale == stockOut.BaleWeight && a.IsActive == true && a.WarehouseId == stockOut.WarehouseId && a.SupplierId == stockOut.SupplierId).ToList();

            if (existingItem.Count > 0)
            {
                foreach (var inv in existingItem)
                {
                    inv.UpdatedDate   = DateTime.Now;
                    inv.UpdatedBy     = CurrentSession.GetCurrentSession().UserName;
                    inv.ProductionQty = stockOut.BaleQty;
                    inv.BalanceQty    = inv.BalanceQty - stockOut.BaleQty ?? 0;
                    inventory.Update(inv, inv.Id);
                }
            }
            return(service.Save(stockOut));
        }
コード例 #29
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            var rd = HttpContext.Current.Session["RD"] as ReportDocument;

            if (rd != null)
            {
                rd.Close();
                rd.Dispose();
                GC.Collect();
            }

            if (CurrentSession.GetCurrentSession() == null)
            {
                string redirectUrl = string.Format("~/Login/Logout");
                filterContext.Result = new RedirectResult(redirectUrl);
            }
        }
コード例 #30
0
        public ActionResult Edit(Category model)
        {
            if (model == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Category category = db.GetById(model.Id);

            if (category == null)
            {
                return(HttpNotFound());
            }
            model.IsActive   = true;
            model.UpdateDate = DateTime.Now.ToString();
            model.UpdatedBy  = CurrentSession.GetCurrentSession().UserName;
            db.Update(model, model.Id);
            return(Json("Updated", JsonRequestBehavior.AllowGet));
        }