private string SaveBranchInfo(VMMasterForm MstrInf) { var BrCode = _brInfoService.All().ToList().FirstOrDefault(x => x.BranchCode == MstrInf.Code); if (BrCode == null) { Branch _brInfo = new Branch(); _brInfo.BranchCode = MstrInf.Code; _brInfo.BranchName = MstrInf.Name; _brInfo.BrLocalName = MstrInf.LocalName; _brInfo.BrAddress = MstrInf.Descr; _brInfoService.Add(_brInfo); _brInfoService.Save(); var BrID = _brInfo.BrID; TransactionLogService.SaveTransactionLog(_transactionLogService, "MasterInformation", "SaveBranchInfo", BrID.ToString(), Session["UserName"].ToString()); return("1"); } else { return("2"); } }
public SelectList PermittedBranch() { var UserId = _secUserInfoService.All().Where(x => x.UserName == Session["UserName"].ToString()).FirstOrDefault().UserID; List <Branch> branchs = _BranchService.All().ToList(); List <UserBranch> userbranch = _userbranchService.All().ToList(); var branchInfo = (from ii in userbranch join i in branchs on ii.BranchCode equals i.BranchCode where ii.Userid == UserId.ToString() select new { BranchCode = ii.BranchCode, BranchName = i.BranchName }).ToList(); if (branchInfo.Count == 1) { return(new SelectList(branchInfo.OrderBy(x => x.BranchCode), "BranchCode", "BranchName")); } else if (branchInfo.Count > 1) { branchInfo.Insert(0, new { BranchCode = "0", BranchName = "All" }); return(new SelectList(branchInfo.OrderBy(x => x.BranchCode), "BranchCode", "BranchName")); } else { return(null); } }
public ActionResult ChequeReceipts(string errMsg) { if (Session["UserID"] != null) { ViewBag.BranchCode = new SelectList(_branchService.All().ToList(), "BranchCode", "BranchName"); ViewBag.Accode = LoadDropDown.LoadMRAgainstDDL(); ViewBag.SubCode = new SelectList(_subsidiaryService.All().Where(x => x.SubType == "1").ToList(), "SubCode", "SubName");//LoadDropDown.LoadSubsidiaryByPurpuse("", _subsidiaryService, _subsidiaryCtrlService); ViewBag.BankCode = new SelectList(_bankInfoService.All().ToList(), "BankCode", "BankName"); ViewBag.DepositBank = LoadDropDown.LoadDepositBankDDL(); ViewBag.UpdateBy = new SelectList(_employeeInfoService.All().ToList(), "Id", "UserName"); DateTime datetime = DateTime.Now; ViewBag.GLProvition = Counter("BR"); ViewBag.GLEntries = CountEntries("BR", datetime); var sysSet = _sysSetService.All().ToList().FirstOrDefault(); ViewBag.MaintJob = sysSet.MaintJob; ViewBag.JobNo = LoadDropDown.LoadJobInfo(); var VchrConv = _vchrSetService.All().ToList().FirstOrDefault().VchrConv; Session["VchrConv"] = VchrConv; ViewBag.errMsg = errMsg; return(View()); } else { return(RedirectToAction("SecUserLogin", "SecUserLogin")); } }
// GET: CashMoneyReceipt public ActionResult CashMoneyReceipt(string errMsg) { if (Session["UserID"] != null) { ViewBag.ProjCode = new SelectList(_ProjInfoService.All().ToList(), "ProjCode", "ProjName"); ViewBag.BranchCode = new SelectList(_branchService.All().ToList(), "BranchCode", "BranchName"); ViewBag.MRAgainst = LoadDropDown.LoadMRAgainstDDL(); ViewBag.CustCode = new SelectList(_subsidiaryInfoService.All().ToList().Where(x => x.SubType == "1"), "SubCode", "SubName"); var VchrConv = _vchrSetService.All().ToList().FirstOrDefault().VchrConv; Session["VchrConv"] = VchrConv; ViewBag.MRSL = LoadDropDown.GenerateRecvSlNo(_moneyReceiptService, "", Session["BranchCode"].ToString(), "", Session["VchrConv"].ToString()); DateTime datetime = DateTime.Now; ViewBag.GLProvition = Counter("CR"); ViewBag.GLEntries = CountEntries("CR", datetime); var sysSet = _sysSetService.All().ToList().FirstOrDefault(); ViewBag.MaintJob = sysSet.MaintJob; ViewBag.JobNo = LoadDropDown.LoadJobInfo(); ViewBag.errMsg = errMsg; return(View()); } else { return(RedirectToAction("SecUserLogin", "SecUserLogin")); } }
public ActionResult VMBIN() { var itemProj = new SelectList(_ProjInfoService.All().ToList(), "ProjCode", "ProjName"); List <SelectListItem> _list = itemProj.ToList(); _list.Insert(0, new SelectListItem() { Value = "-1", Text = "---select---" }); itemProj = new SelectList((IEnumerable <SelectListItem>)_list, "Value", "Text"); ViewBag.ProjCode = itemProj; var itemBranch = new SelectList(_BranchService.All().ToList(), "BranchCode", "BranchName"); List <SelectListItem> _listBranch = itemBranch.ToList(); _listBranch.Insert(0, new SelectListItem() { Value = "-1", Text = "---select---" }); itemBranch = new SelectList((IEnumerable <SelectListItem>)_listBranch, "Value", "Text"); ViewBag.BranchCode = itemBranch; return(View()); }
public ActionResult Vat6P9P1_1Rpt(string errMsg) { if (Session["UserID"] != null) { AcclineERPContext dbContext = new AcclineERPContext(); var Fydd = _FYDDService.All().FirstOrDefault(s => s.FinYear == Session["FinYear"].ToString()); ViewBag.BranchCode = new SelectList(_BranchService.All().ToList(), "BranchCode", "BranchName"); ViewBag.ProjCode = new SelectList(_ProjInfoService.All().ToList(), "ProjCode", "ProjName"); ViewBag.DesignationCode = new SelectList(dbContext.Designation, "DesigCode", "DesigDesc"); //ViewBag.DesignationCode = LoadDropDown.LoadAllDesignation(_designationService); //ViewBag.des = new SelectList(_designationService.All().ToList(), "DesigCode", "DesigDesc"); ViewBag.ApprBy = LoadAppBy(_employeeInfoService); ViewBag.FyddFDate = Fydd.FYDF; ViewBag.FyddTDate = Fydd.FYDT; ViewBag.FinYear = LoadDropDown.LoadAllFinYears(_FYDDService); ViewBag.Message = errMsg; return(View()); } else { return(RedirectToAction("SecUserLogin", "SecUserLogin")); } }
public ActionResult GetGLEntries(DateTime date, string pageType) { RBACUser rUser = new RBACUser(Session["UserName"].ToString()); if (!rUser.HasPermission("PurchaseReturn_VchrList")) { string errMsg = "VL"; return(RedirectToAction("PurchaseReturn", "PurchaseReturn", new { errMsg })); } string branchCode = Session["BranchCode"].ToString(); string sql = string.Format("EXEC GLEntriesByDate '" + pageType + "', '" + date.ToString("MM-dd-yyyy") + "','" + branchCode + "'"); List <JarnalVoucher> glReport = _jarnalVoucherService.SqlQueary(sql).ToList(); if (glReport.Count == 0) { string errMsg = "Data not pound !!!"; return(RedirectToAction("PurchaseReturn", "PurchaseReturn", new { errMsg })); } else { //string branchCode = Session["BranchCode"].ToString(); ViewBag.branchCode = _branchService.All().ToList().FirstOrDefault(x => x.BranchCode == branchCode).BranchName; ViewBag.glDate = date; return(View("~/Views/CashOperation/GLEntres.cshtml", glReport)); } }
// GET: StockLedgerRpt public ActionResult StockLedgerRpt(string errMsg) { if (Session["UserID"] != null) { ViewBag.BranchCode = new SelectList(_BranchService.All().ToList(), "BranchCode", "BranchName"); //GardenSelection(); ViewBag.AccountCode = new SelectList(_ItemService.All().ToList(), "ItemCode", "ItemName"); ViewBag.ItemType = new SelectList(_itemTypeService.All().ToList(), "ItemTypeCode", "ItemTypeName"); var Fydd = _FYDDService.All().FirstOrDefault(s => s.FinYear == Session["FinYear"].ToString()); ViewBag.FyddFDate = Fydd.FYDF; ViewBag.FyddTDate = Fydd.FYDT; var sysSet = _sysSetService.All().ToList().FirstOrDefault(); ViewBag.Group = LoadDropDown.LoadGroupInfoByItemType("", _CommonVmService); ViewBag.SubGroup = LoadDropDown.LoadSGroupByGroupId("", "", _CommonVmService); ViewBag.SubSubGroup = LoadDropDown.LoadSSGroupInfo("", "", "", _CommonVmService); #region For item Filtering option ViewBag.NoGrp = sysSet.NoGrp; ViewBag.OnlyGrp = sysSet.OnlyGrp; ViewBag.GrpAndSubGrp = sysSet.GrpAndSubGrp; ViewBag.SubSubGrp = sysSet.SubSubGrp; #endregion ViewBag.Message = errMsg; return(View()); } else { return(RedirectToAction("SecUserLogin", "SecUserLogin")); } }
public ActionResult GetVoucherPreview(string VchrNo, string FinYear) { RBACUser rUser = new RBACUser(Session["UserName"].ToString()); if (!rUser.HasPermission("RptVoucherPreview_Preview")) { string errMsg = "No Preview Permission for this User !!"; return(RedirectToAction("SearchVoucher", "VchrPreview", new { errMsg })); } if (VchrNo != null) { var ledger = _LedgerCapService.All().ToList().FirstOrDefault(x => x.SP_Name == "rptVoucher"); ViewBag.RptCap = ledger.RptCap; ViewBag.Col1Cap = ledger.Col1Cap; ViewBag.Col2Cap = ledger.Col2Cap; ViewBag.Col3Cap = ledger.Col3Cap; ViewBag.Col4Cap = ledger.Col4Cap; ViewBag.Col5Cap = ledger.Col5Cap; ViewBag.Col6Cap = ledger.Col6Cap; ViewBag.Col7Cap = ledger.Col7Cap; string BranchCode = Session["BranchCode"].ToString(); ViewBag.Branch = _BranchService.All().Where(x => x.BranchCode == BranchCode.Trim()).Select(s => s.BranchName).ToString(); FinYear = Session["FinYear"].ToString(); string sql = string.Format("EXEC rptVoucher '" + FinYear + "','" + VchrNo + "'"); List <VchrPreviewVM> rptVchr = _VchrPreviewVMService.SqlQueary(sql).ToList(); //if (rptVchr.Count == 0) //{ // string errMsg = "There is no data in this combination. Please try again !!!"; // return RedirectToAction("SearchVoucher", "VchrPreview", new { errMsg }); //} //else //{ double amt = 0; foreach (var item in rptVchr) { if (item.cramount != 0) { amt += item.cramount; } } string InWordsamt = InWord.ConvertToWords(amt.ToString()); ViewBag.InWordsAmt = InWordsamt; return(View(rptVchr)); //} } else { string errMsg = "Voucher no is required!"; return(RedirectToAction("SearchVoucher", "VchrPreview", new { errMsg })); } }
// GET: OnlineMoneyReceipt public ActionResult OnlineMoneyReceipt() { if (Session["UserID"] != null) { ViewBag.BranchCode = new SelectList(_branchService.All().ToList(), "BranchCode", "BranchName"); ViewBag.MRAgainst = LoadDropDown.LoadMRAgainstDDL(); ViewBag.CustCode = new SelectList(_subsidiaryInfoService.All().Where(x => x.SubType == "1").ToList(), "SubCode", "SubName"); ViewBag.bankCode = new SelectList(_bankInfoService.All().ToList(), "BankCode", "BankName"); ViewBag.DepositBank = LoadDropDown.LoadDepositBankDDL(); ViewBag.CollectedBy = new SelectList(_employeeInfoService.All().ToList(), "Id", "UserName"); var CashAc = _defACService.All().ToList().FirstOrDefault().CashAc; ViewBag.Accode = LoadDropDown.LoadGLAc(CashAc, _newChartService); DateTime datetime = DateTime.Now; ViewBag.GLProvition = Counter("BR"); ViewBag.GLEntries = CountEntries("BR", datetime); var sysSet = _sysSetService.All().ToList().FirstOrDefault(); ViewBag.MaintJob = sysSet.MaintJob; ViewBag.JobNo = LoadDropDown.LoadJobInfo(); ViewBag.GetwayId = LoadDropDown.LoadGetwayProvider(); var VchrConv = _vchrSetService.All().ToList().FirstOrDefault().VchrConv; Session["VchrConv"] = VchrConv; return(View()); } else { return(RedirectToAction("SecUserLogin", "SecUserLogin")); } }
public ActionResult GL_OpenBal() { ViewBag.ProjCode = new SelectList(_ProjInfoService.All().ToList(), "ProjCode", "ProjName"); ViewBag.BranchCode = new SelectList(_BranchService.All().ToList(), "BranchCode", "BranchName"); var defAc = LoadDropDown.GetDefAc(); List <NewChart> charts = _NewChartAppService.All().ToList().Where(x => x.Accode.Substring(0, 1) == defAc.AssAc || x.Accode.Substring(0, 1) == defAc.LiaAc).ToList(); List <NewChart> finalList = new List <NewChart>(); foreach (var chart in charts) { bool key = true; foreach (var temp in charts) { if (chart == temp) { } else { if (chart.Accode == temp.ParentAcCode) { key = false; } } } if (key) { finalList.Add(chart); } } ViewBag.Accode = new SelectList(finalList, "Accode", "AcName"); return(View()); }
public ActionResult CollectionStatementRpt(string errMsg) { if (Session["UserID"] != null) { ViewBag.BranchCode = new SelectList(_BranchService.All().ToList(), "BranchCode", "BranchName");//GardenSelection(); ViewBag.ProjCode = new SelectList(_ProjInfoService.All().ToList(), "ProjCode", "ProjName"); var Fydd = _FYDDService.All().FirstOrDefault(s => s.FinYear == Session["FinYear"].ToString()); ViewBag.FyddFDate = Fydd.FYDF; ViewBag.FyddTDate = Fydd.FYDT; ViewBag.Message = errMsg; return(View()); } else { return(RedirectToAction("SecUserLogin", "SecUserLogin")); } }
// GET: ProductionRpt public ActionResult ProductionRpt(string errMsg) { if (Session["UserID"] != null) { ViewBag.ItemType = new SelectList(_itemTypeService.All().ToList(), "ItemTypeCode", "ItemTypeName"); ViewBag.ItemCode = LoadDropDown.LoadItemByItemType("", _CommonVmService); ViewBag.BranchCode = new SelectList(_branchService.All().ToList(), "BranchCode", "BranchName"); var Fydd = _FYDDService.All().FirstOrDefault(s => s.FinYear == Session["FinYear"].ToString()); ViewBag.FyddFDate = Fydd.FYDF; ViewBag.FyddTDate = Fydd.FYDT; ViewBag.Message = errMsg; return(View()); } else { return(RedirectToAction("SecUserLogin", "SecUserLogin")); } }
// // GET: /ListOfTransection/ public ActionResult Search(string errMsg) { if (Session["UserID"] != null) { //ViewBag.Branch = _BranchService.All().FirstOrDefault(x => x.BranchCode == Session["BranchCode"].ToString()).BranchName; ViewBag.JTrGrpId = new SelectList(_jTrGrpService.All().ToList(), "VType", "TypeDesc"); ViewBag.BranchCode = new SelectList(_BranchService.All().ToList(), "BranchCode", "BranchName"); //GardenSelection(); var Fydd = _FYDDService.All().FirstOrDefault(s => s.FinYear == Session["FinYear"].ToString()); ViewBag.FyddFDate = Fydd.FYDF; ViewBag.FyddTDate = Fydd.FYDT; ViewBag.Message = errMsg; return(View()); } else { return(RedirectToAction("SecUserLogin", "SecUserLogin")); } }
public ActionResult Search(string errMsg) { if (Session["UserID"] != null) { ViewBag.LedgerTypeCode = new SelectList(_LedgerTypeService.All().ToList(), "LedgerTypeCode", "LedgerTypeName"); ViewBag.BranchCode = new SelectList(_BranchService.All().ToList(), "BranchCode", "BranchName"); //GardenSelection(); ViewBag.AccountCode = LoadDropDown.LoadAccount("", _ItemService, _SubsidiaryService, _NewChartService); var Fydd = _FYDDService.All().FirstOrDefault(s => s.FinYear == Session["FinYear"].ToString()); ViewBag.FyddFDate = Fydd.FYDF; ViewBag.FyddTDate = Fydd.FYDT; //var sysSet = _sysSetService.All().ToList().FirstOrDefault(); ViewBag.Message = errMsg; return(View()); } else { return(RedirectToAction("SecUserLogin", "SecUserLogin")); } }
public ActionResult Montly_Amount_Quantity_Rpt(string errMsg) { if (Session["UserID"] != null) { ViewBag.Location = new SelectList(_ILocationAppService.All().ToList(), "LocCode", "LocName").ToList(); //GardenSelection(); ViewBag.CustomerName = new SelectList(_ISubsidiaryInfoService.All().ToList().Where(x => x.SubType == "1"), "SubCode", "SubName"); ViewBag.BranchCode = new SelectList(_BranchService.All().ToList(), "BranchCode", "BranchName"); //GardenSelection(); ViewBag.ProjCode = new SelectList(_ProjInfoService.All().ToList(), "ProjCode", "ProjName"); var Fydd = _FYDDService.All().FirstOrDefault(s => s.FinYear == Session["FinYear"].ToString()); ViewBag.FyddFDate = Fydd.FYDF; ViewBag.FyddTDate = Fydd.FYDT; ViewBag.Message = errMsg; return(View()); } else { return(RedirectToAction("SecUserLogin", "SecUserLogin")); } }
// GET: Store public ActionResult StoreRpt(string errMsg) { if (Session["UserID"] != null) { var Fydd = _FYDDService.All().FirstOrDefault(s => s.FinYear == Session["FinYear"].ToString()); ViewBag.BranchCode = new SelectList(_BranchService.All().ToList(), "BranchCode", "BranchName"); ViewBag.ItemCode = new SelectList(_ItemInfoService.All().ToList(), "ItemCode", "ItemName"); ViewBag.Source = new SelectList(_issRecvSrcDestService.All().ToList().Where(x => x.Type == "S"), "SrcDestId", "SrcDestName"); ViewBag.DesLocCode = new SelectList(_issRecvSrcDestService.All().ToList().Where(x => x.Type == "D"), "SrcDestId", "SrcDestName"); ViewBag.FyddFDate = Fydd.FYDF; ViewBag.FyddTDate = Fydd.FYDT; ViewBag.Message = errMsg; return(View()); } else { return(RedirectToAction("SecUserLogin", "SecUserLogin")); } }
public ActionResult Search(string errMsg, string RptCaption) { if (Session["UserID"] != null) { //ViewBag.LedgerTypeCode = new SelectList(_SumRptTypeService.All().ToList(), "ReportTypeCode", "ReportTypeName"); ViewBag.LedgerTypeCode = new SelectList(_LedgerCapService.All().ToList(), "SP_Name", "RptName"); //var result = EFContext.TestAddresses.Select(m => m.Name).Distinct(); //callList.Select(c => c.ApplicationID).Distinct() // var query = prodDtcx.PersonAddress.Select(adr => adr.City).OrderBy(adr.City) .Distinct(); //same data avoid (shahin) ViewBag.LevelNo = new SelectList(_newchartAppService.All().Select(x => new { LevelNo = x.LevelNo }) .Distinct(), "LevelNo", "LevelNo"); ViewBag.LocCode = new SelectList(_locationService.All().ToList(), "LocCode", "LocName"); ViewBag.BranchCode = new SelectList(_BranchService.All().ToList(), "BranchCode", "BranchName");//GardenSelection(); var Fydd = _FYDDService.All().FirstOrDefault(s => s.FinYear == Session["FinYear"].ToString()); ViewBag.FyddFDate = Fydd.FYDF; ViewBag.FyddTDate = Fydd.FYDT.ToString("dd/MM/yyyy"); ViewBag.Message = errMsg; if (RptCaption == "rptTBProcess") { ViewBag.RptCaption = "Trial Balance"; } else if (RptCaption == "rptStockSumm") { ViewBag.RptCaption = "Stock Summary"; } return(View()); } else { return(RedirectToAction("SecUserLogin", "SecUserLogin")); } }
public ActionResult SalesCollectionComparisonSearch(string errMsg) { if (Session["UserID"] != null) { var Fydd = _FYDDService.All().FirstOrDefault(s => s.FinYear == Session["FinYear"].ToString()); ViewBag.FyddFDate = Fydd.FYDF; ViewBag.FyddTDate = Fydd.FYDT; string branchCode = Session["BranchCode"].ToString(); ViewBag.Location = new SelectList(_locationService.All().ToList(), "LocCode", "LocName"); ViewBag.BranchCode = new SelectList(_BranchService.All().ToList(), "BranchCode", "BranchName"); //GardenSelection(); ViewBag.ProjCode = new SelectList(_ProjInfoService.All().ToList(), "ProjCode", "ProjName"); ViewBag.SubCode = new SelectList(_SubsidiaryService.All().ToList(), "SubCode", "SubName"); ViewBag.errMsg = errMsg; return(View()); } else { return(RedirectToAction("SecUserLogin", "SecUserLogin")); } }
public ActionResult TakeDecision() { string branchCode = Session["BranchCode"].ToString(); ViewBag.branchCode = _BranchService.All().ToList().Where(x => x.BranchCode == branchCode).Select(s => s.BranchName).ToString(); var banks = _newChartService.All().Where(x => x.BranchCode == branchCode).ToList(); if (banks.Count == 1) { var bank = _newChartService.All().ToList().FirstOrDefault(x => x.BranchCode == branchCode); Session["BankAccode"] = bank.Accode; return(RedirectToAction("BankOperation", "BankOperation")); } else { return(RedirectToAction("BankSelection", "BankOperation")); } }
public ActionResult Register() { //var branch = _employeeService.All().ToList().FirstOrDefault(x => x.Email == User.Identity.Name); //Session["Garden"] = branch.BranchCode; List <string> roles = new List <string>(); // List<string> branch = new List<string>(); foreach (string role in System.Web.Security.Roles.GetAllRoles().ToList()) { roles.Add(role); } ViewBag.Roles = roles; //ViewBag.BranchCode = branch; ViewBag.BranchCode = new SelectList(_branchService.All().ToList(), "BranchCode", "BranchName"); ViewBag.Id = new SelectList(_employeeService.All().ToList(), "Id", "UserName"); // ViewBag.RecvItem = LoadDropDown.LoadItem(_itemInfoService); return(View()); }
public ActionResult ItemWiseSalesStatementRpt(string errMsg) { if (Session["UserID"] != null) { ViewBag.BranchCode = new SelectList(_BranchService.All().ToList(), "BranchCode", "BranchName"); ViewBag.LocCode = new SelectList(_locationService.All().ToList(), "LocCode", "LocName"); ViewBag.ItemCode = LoadDropDown.LoadItems(_ItemService); var Fydd = _FYDDService.All().FirstOrDefault(s => s.FinYear == Session["FinYear"].ToString()); ViewBag.FyddFDate = Fydd.FYDF; ViewBag.FyddTDate = Fydd.FYDT; ViewBag.Message = errMsg; return(View()); } else { return(RedirectToAction("SecUserLogin", "SecUserLogin")); } }
// GET: JobWiseRecPay public ActionResult JobWiseRecPay(string errMsg) { if (Session["UserID"] != null) { ViewBag.ProjCode = new SelectList(_ProjInfoService.All().ToList(), "ProjCode", "ProjName"); ViewBag.BranchCode = new SelectList(_BranchService.All().ToList(), "BranchCode", "BranchName"); //ViewBag.FYDD = new SelectList(_FYDDService.All().ToList(), "FinYear", "FinYear"); ViewBag.JobNo = LoadDropDown.LoadJobInfo(); var Fydd = _FYDDService.All().FirstOrDefault(s => s.FinYear == Session["FinYear"].ToString()); ViewBag.FyddFDate = Fydd.FYDF; ViewBag.FyddTDate = Fydd.FYDT; ViewBag.Message = errMsg; return(View()); } else { return(RedirectToAction("SecUserLogin", "SecUserLogin")); } }
// GET: IncomeExpenditure public ActionResult IncomeExpenditure() { if (Session["UserID"] != null) { ViewBag.ProjName = new SelectList(_ProjInfoService.All().ToList(), "ProjCode", "ProjName"); ViewBag.BrName = new SelectList(_BranchService.All().ToList(), "BrCode", "BrName"); ViewBag.FYDD = new SelectList(_FYDDService.All().ToList(), "FinYear", "FinYear"); var Fydd = _FYDDService.All().FirstOrDefault(s => s.FinYear == Session["FinYear"].ToString()); ViewBag.FyddFDate = Fydd.FYDF; ViewBag.FyddTDate = Fydd.FYDT; //ViewBag.RptCaption = "Income and Expenditure A/C Report"; return(View()); } else { return(RedirectToAction("SecUserLogin", "SecUserLogin")); } }
public ActionResult CustomerWiseRateChartRptPdf(string BranchCode, string SubCode) { string sql = string.Format("Exec rpt_CustWiseRateChart '" + Session["BranchCode"].ToString() + "','" + SubCode + "'"); IEnumerable <CustomerWiseRateChartVM> VchrLst; using (AcclineERPContext dbContext = new AcclineERPContext()) { VchrLst = dbContext.Database.SqlQuery <CustomerWiseRateChartVM>(sql).ToList(); } ViewBag.BranchCode = _BranchService.All().Where(s => s.BranchCode == BranchCode).Select(x => x.BranchName).FirstOrDefault(); //ViewBag.fDate = InWord.GetAbbrMonthNameDate(fDate); //ViewBag.tDate = InWord.GetAbbrMonthNameDate(tDate); return(new Rotativa.ViewAsPdf("rpt_CustomerWiseRateChartPdf", "", VchrLst) { PageOrientation = Rotativa.Options.Orientation.Portrait, PageSize = Rotativa.Options.Size.A4, CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\"" }); }
public ActionResult BalSheetRpt(string errMsg, string RptCaption) { if (Session["UserID"] != null) { ViewBag.ProjName = new SelectList(_ProjInfoService.All().ToList(), "ProjCode", "ProjName"); ViewBag.BrName = new SelectList(_BranchService.All().ToList(), "BrCode", "BrName"); ViewBag.FYDD = new SelectList(_FYDDService.All().ToList(), "FinYear", "FinYear"); var Fydd = _FYDDService.All().FirstOrDefault(s => s.FinYear == Session["FinYear"].ToString()); ViewBag.FyddTDate = Fydd.FYDT; ViewBag.Message = errMsg; if (RptCaption == "rptBalanceSheet") { ViewBag.RptCaption = "Balance Sheet Report"; } return(View()); } else { return(RedirectToAction("SecUserLogin", "SecUserLogin")); } }
public ActionResult Login(VMLogin user) { try { string Pass = SHA1.Encode(user.Password); var UserInfo = (from mi in _secUserInfoService.All().ToList() where mi.UserName == user.UserName && mi.Password == SHA1.Encode(user.Password) select new { UserID = mi.UserID, UserName = mi.UserName, Password = mi.Password, Email = mi.Email }).FirstOrDefault(); var HasBranch = _sysSetService.All().FirstOrDefault().HasBranch; if (HasBranch == true) { if (UserInfo != null) { Session["ProjCode"] = "01"; Session["UserID"] = UserInfo.UserID; Session["UserName"] = UserInfo.UserName; Session["FinYear"] = user.FinYear; var sysSet = _sysSetService.All().FirstOrDefault(); if (sysSet.HasSale == true) { string token = GetToken(ConfigurationManager.AppSettings["ApiUrl"], UserInfo.UserName, UserInfo.Password); Session["token"] = token; } return(RedirectToAction("LogInWithBranch", "SecUserLogin")); } else { ViewBag.Message = "Login data is incorrect!"; return(RedirectToAction("SecUserLogin", "SecUserLogin")); } } else { if (UserInfo != null) { Session["ProjCode"] = "01"; Session["UserID"] = UserInfo.UserID; Session["UserName"] = UserInfo.UserName; Session["FinYear"] = user.FinYear; Session["BranchCode"] = _branchService.All().FirstOrDefault().BranchCode; var sysSet = _sysSetService.All().FirstOrDefault(); if (sysSet.HasSale == true) { string token = GetToken(ConfigurationManager.AppSettings["ApiUrl"], UserInfo.UserName, UserInfo.Password); Session["token"] = token; } return(RedirectToAction("Index", "Home")); } else { ViewBag.Message = "Login data is incorrect!"; return(RedirectToAction("SecUserLogin", "SecUserLogin")); } } } catch (System.Exception) { throw; } }