예제 #1
0
        public ActionResult TransWiseVat9P1_SF_KaRptPdf(string Project, string Branch, DateTime fDate, DateTime tDate, string Year, string Month, string FinYear, string command)
        {
            FinYear = Session["FinYear"].ToString();
            string sql = string.Format("EXEC VM_rpt9P1_SF_Ka_1 '" + Project + "', '" + Branch + "', '" + FinYear + "', '" + Year + "', '" + Month + "','" + fDate.ToString("yyyy/MM/dd") + "', '" + tDate.ToString("yyyy/MM/dd") + "',''");
            IEnumerable <Vat9P1_SF_Ka> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <Vat9P1_SF_Ka>(sql).ToList();
            }

            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            if (command == "Preview")
            {
                return(View("rptVat9P1_SF_KaRptPdf", VchrLst));
            }
            else
            {
                return(View("rptVat9P1_SF_KaRptPdfPrint", VchrLst));
            }
        }
예제 #2
0
        public ActionResult TransWiseVatRptPdf(DateTime fDate, DateTime tDate, string TransNo, string command)
        {
            string FinYear = Session["FinYear"].ToString();
            string sql     = string.Format("EXEC VM_rpt6P1  '" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "','" + TransNo + "', '" + FinYear + "','" + Session["ProjCode"].ToString() + "','" + Session["BranchCode"].ToString() + "'");
            IEnumerable <VatStatementVM> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <VatStatementVM>(sql).ToList();
            }
            ViewBag.fDate = InWord.GetAbbrMonthNameDate(fDate);
            ViewBag.tDate = InWord.GetAbbrMonthNameDate(tDate);

            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;


            if (command == "Preview")
            {
                return(View("rptVatPdf", VchrLst));
            }
            else
            {
                return(View("~/Views/VATRpt/rptVatPdf - Copy.cshtml", VchrLst));
            }
        }
예제 #3
0
        public ActionResult GetDataForSelectedGroup(int GroupTypeId)
        {
            if (GroupTypeId == 1)
            {
                string sql = string.Format("select * from GroupInfo");
                IEnumerable <GroupInfo> GroupinfoList;
                using (AcclineERPContext dbContext = new AcclineERPContext())
                {
                    GroupinfoList = dbContext.Database.SqlQuery <GroupInfo>(sql).ToList();
                }
                return(Json(new { GroupinfoList = GroupinfoList, GroupTypeId = GroupTypeId }, JsonRequestBehavior.AllowGet));
            }
            else if (GroupTypeId == 2)
            {
                string sql = string.Format("select * from SGroupInfo");
                IEnumerable <SGroupInfo> GroupinfoList;
                using (AcclineERPContext dbContext = new AcclineERPContext())
                {
                    GroupinfoList = dbContext.Database.SqlQuery <SGroupInfo>(sql).ToList();
                }
                return(Json(new { GroupinfoList = GroupinfoList, GroupTypeId = GroupTypeId }, JsonRequestBehavior.AllowGet));
            }
            else if (GroupTypeId == 3)
            {
                string sql = string.Format("select * from SSGroupInfo");
                IEnumerable <SSGroupInfo> GroupinfoList;
                using (AcclineERPContext dbContext = new AcclineERPContext())
                {
                    GroupinfoList = dbContext.Database.SqlQuery <SSGroupInfo>(sql).ToList();
                }
                return(Json(new { GroupinfoList = GroupinfoList, GroupTypeId = GroupTypeId }, JsonRequestBehavior.AllowGet));
            }

            return(Json(JsonRequestBehavior.AllowGet));
        }
예제 #4
0
        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 PostCancel(string InvoiceNo, string CancelType)
        {
            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("MRCancel"))
            {
                return(Json("C", JsonRequestBehavior.AllowGet));
            }
            string ReturnSTR = "";

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                var resultParameter = new SqlParameter("@ReturnMSG", SqlDbType.VarChar, 300)
                {
                    Direction = ParameterDirection.Output
                };


                dbContext.Database.ExecuteSqlCommand("MRCancel @MRNo, @ReturnMSG out",
                                                     new SqlParameter("@MRNo", InvoiceNo),
                                                     resultParameter);

                ReturnSTR = (string)resultParameter.Value;
                TransactionLogService.SaveTransactionLog(_transactionLogService, "Cancel", "MRCancel",
                                                         InvoiceNo, Session["UserName"].ToString());
            }
            return(Json(ReturnSTR, JsonRequestBehavior.AllowGet));
        }
        public ActionResult MontlyQuantityRptPdf(DateTime fDate, DateTime tDate, string ProjCode, string BranchCode, string FinYear)
        {
            string customerGroup = "";
            //rpt_SP_ProdSales_Qty @fdate smalldatetime, @tdate smalldatetime, @ProjCode varchar(3), @BranchCode
            string sql = string.Format("EXEC rpt_SP_ProdSales_Qty '" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "','" + ProjCode + "', '" + BranchCode + "'");
            IEnumerable <MontlyQuantity> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <MontlyQuantity>(sql).ToList();
            }
            var FY = FinYear;

            ViewBag.BranchCode = _BranchService.All().Where(s => s.BranchCode == BranchCode).Select(x => x.BranchName).FirstOrDefault();
            //ViewBag.fDate = fDate.ToString("dd-MMM-yyyy");
            //ViewBag.tDate = tDate.ToString("dd-MMM-yyyy");
            ViewBag.fDate = InWord.GetAbbrMonthNameDate(fDate);
            ViewBag.tDate = InWord.GetAbbrMonthNameDate(tDate);

            //Response.AppendHeader("Content-Disposition", "inline; filename=" + RptName + "_" + DateTime.Now.ToShortDateString() + ".pdf");
            return(new Rotativa.ViewAsPdf("rptSalesCollectionStatePdf", "", 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\""
            });
        }
예제 #7
0
        public ActionResult TransWiseVat6P8RptPdf(string TransNo, string FinYear, string command)
        {
            string sql = string.Format("EXEC VM_rpt6P8 '" + TransNo + "', '" + FinYear + "'");
            IEnumerable <VM_6P8> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <VM_6P8>(sql).ToList();
            }

            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            if (command == "Preview")
            {
                return(View("rptVat6P8Pdf", VchrLst));
            }
            else
            {
                return(View("rptVat6P8PdfPrint", VchrLst));
            }
        }
예제 #8
0
        public ActionResult ItemWiseSalesStatementRptPdf(DateTime fDate, DateTime tDate, string BranchCode, string LocCode, string FinYear, string ItemCode)
        {
            string sql = string.Format("Exec rpt_ItemWiseSalesStat '" + BranchCode + "','" + LocCode + "','" + ItemCode + "', '" + fDate.ToString("yyyy/MM/dd") + "', '" + tDate.ToString("yyyy/MM/dd") + "'");
            IEnumerable <ItemWiseSaleVM> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <ItemWiseSaleVM>(sql).ToList();
            }
            ViewBag.LocName = _locationService.All().Where(s => s.LocCode == LocCode).Select(x => x.LocName).FirstOrDefault();

            ViewBag.fDate = InWord.GetAbbrMonthNameDate(fDate);
            ViewBag.tDate = InWord.GetAbbrMonthNameDate(tDate);

            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            return(new Rotativa.ViewAsPdf("rpt_ItemWiseSalesStatementPdf", "", 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 SalesCollectionStatementRptPdf(DateTime fDate, DateTime tDate, string ProjCode, string BranchCode, string FinYear)
        {
            ViewBag.BranchName = "All";
            if (BranchCode != "")
            {
                String BranchName = _BranchService.All().Where(s => s.BranchCode == BranchCode).Select(x => x.BranchName).FirstOrDefault();
                ViewBag.BranchName = BranchName;
            }

            var ChkFYR = GetCompanyInfo.ValidateFinYearDateRange(Convert.ToString(fDate), Convert.ToString(tDate), Session["FinYear"].ToString());

            if (ChkFYR != "")
            {
                return(RedirectToAction("SecUserLogin", "SecUserLogin", new { errMsg = ChkFYR }));
            }

            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("SalesCollectionStatRpt_Preview"))
            {
                string errMsg = "No Preview Permission for this User !!";
                return(RedirectToAction("SecUserLogin", "SecUserLogin", new { errMsg }));
            }



            string customerGroup = "";
            //rpt_SP_SalesCollectionStat_1  @fdate smalldatetime, @tdate smalldatetime, @ProjCode varchar(3), @BranchCode varchar(3),@FinYear varchar(7), @customerGroup varchar(7)

            string sql = string.Format("EXEC rpt_SP_SalesCollectionStat_1 '" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "','" + ProjCode + "', '" + BranchCode + "', '" + FinYear + "','" + customerGroup + "' "); //,'" + Session["UserName"] + "'


            //string sql = string.Format("EXEC rpt_SP_SalesCollectionStat_1 '" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "','" + ProjCode + "', '" + BranchCode + "', '" + FinYear + "','"+ customerGroup +"'");
            IEnumerable <SalesCollectionStat> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <SalesCollectionStat>(sql).ToList();
            }
            ViewBag.BranchCode = _BranchService.All().Where(s => s.BranchCode == BranchCode).Select(x => x.BranchName).FirstOrDefault();
            //ViewBag.fDate = fDate.ToString("dd-MMM-yyyy");
            //ViewBag.tDate = tDate.ToString("dd-MMM-yyyy");
            ViewBag.fDate = InWord.GetAbbrMonthNameDate(fDate);
            ViewBag.tDate = InWord.GetAbbrMonthNameDate(tDate);

            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;
            //Response.AppendHeader("Content-Disposition", "inline; filename=" + RptName + "_" + DateTime.Now.ToShortDateString() + ".pdf");
            return(new Rotativa.ViewAsPdf("rptSalesCollectionStatePdf", "", 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\""
            });
        }
예제 #10
0
        public JsonResult GetMonthlyReturn(int year, int month)
        {
            AcclineERPContext dbContext = new AcclineERPContext();
            var jsonData = new List <MonthlyReturn>();

            jsonData = dbContext.Database.SqlQuery <MonthlyReturn>("select * from VM_MonthlyReturn where P2_TD_Yr=" + year + " and P2_TD_Mon= " + month + "").ToList();
            return(Json(new { data = jsonData }, JsonRequestBehavior.AllowGet));
        }
예제 #11
0
        public JsonResult GetLastMonthReturn(int year, int month)
        {
            DateTime now         = DateTime.Now;
            int      LastMonth   = now.AddMonths(-1).Month;
            int      Currentyear = now.AddMonths(-1).Year;

            AcclineERPContext dbContext = new AcclineERPContext();
            var jsonData = new List <MonthlyReturn>();

            jsonData = dbContext.Database.SqlQuery <MonthlyReturn>("select P2_TD_Mon from VM_MonthlyReturn where P2_TD_Yr=" + Currentyear + " and P2_TD_Mon= " + LastMonth + "").ToList();
            return(Json(new { data = jsonData }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult GetCustomerLedger(RptSearchVModel vmodel, string finyear)
        {
            var ChkFYR = GetCompanyInfo.ValidateFinYearDateRange(Convert.ToString(vmodel.fDate), Convert.ToString(vmodel.tDate), Session["FinYear"].ToString());

            if (ChkFYR != "")
            {
                return(RedirectToAction("SecUserLogin", "SecUserLogin", new { errMsg = ChkFYR }));
            }

            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("CustomerLedgerGDS_Preview"))
            {
                string errMsg = "No Preview Permission for this User !!";
                return(RedirectToAction("SecUserLogin", "SecUserLogin", new { errMsg }));
            }

            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            finyear       = Session["FinYear"].ToString();
            ViewBag.fDate = InWord.GetAbbrMonthNameDate(vmodel.fDate);
            ViewBag.tDate = InWord.GetAbbrMonthNameDate(vmodel.tDate);


            ViewBag.CustCode = vmodel.SubCode;
            ViewBag.Customer = _ISubsidiaryInfoAppService.All().FirstOrDefault(x => x.SubCode == vmodel.SubCode.Trim()).SubName.ToString();
            ViewBag.SubCode  = vmodel.SubCode;



            string sql = string.Format("exec rpt_CustLedger_GDS '" + vmodel.fDate.ToString("yyyy/MM/dd") + "','" + vmodel.tDate.ToString("yyyy/MM/dd") + "','" + vmodel.SubCode + "','" + Session["FinYear"].ToString() + "','" + Session["UserName"] + "'  ");


            IEnumerable <CustomerLedgerVM> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <CustomerLedgerVM>(sql).ToList();
            }

            return(new Rotativa.ViewAsPdf("CustomerLedgerPdf", "", 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\""
            });
        }
예제 #13
0
        public ActionResult BalSheetRptPdf(string ProjName, string RptName, string tDate)
        {
            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("RptBalanceSheet_Preview"))
            {
                string errMsg = "No Preview Permission for this User !!";
                return(RedirectToAction("BalSheetRpt", "BalSheetRpt", new { errMsg }));
            }
            retvalpro PLAmountPro;
            decimal   plAmt   = 0;
            string    plAmts  = "0";
            string    FinYear = Session["FinYear"].ToString();
            DateTime  FYDF    = _FYDDService.All().FirstOrDefault(s => s.FinYear == FinYear).FYDF;

            string sqlp = string.Format("EXEC PLAmount '" + FinYear + "','" + ProjName + "', '" + Session["BranchCode"] + "', '" + FYDF.ToString("MM/dd/yyyy") + "', '" + Convert.ToDateTime(tDate).ToString("MM/dd/yyyy") + "','" + FinYear + "'");

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                PLAmountPro = dbContext.Database.SqlQuery <retvalpro>(sqlp).FirstOrDefault();
                plAmt       = PLAmountPro.PLAmount;
                plAmts      = Convert.ToString(plAmt).Replace(",", ".");
            }

            string sql = string.Format("Exec rptIncExpAC2 '" + ProjName + "', '', '" + Convert.ToDateTime(tDate).ToString("MM/dd/yyyy") + "', '" + FinYear + "', '" + plAmts + "'");



            //string sql = string.Format("Exec rptIncExpAC2 '" + ProjName + "','" + Session["BranchCode"].ToString() + "','" + Convert.ToDateTime(tDate).ToString("MM/dd/yyyy") + "','" + Session["FinYear"].ToString() + "'");

            List <BalSheetRptVM> balSheet = _BalSheetRptService.SqlQueary(sql).ToList();

            ViewBag.PlAmount = plAmt;
            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;
            Response.AppendHeader("Content-Disposition", "inline; filename=" + RptName + "_" + DateTime.Now.ToShortDateString() + ".pdf");
            return(new Rotativa.ViewAsPdf("BalSheetRptPdf", "", balSheet)
            {
                PageOrientation = Rotativa.Options.Orientation.Portrait,
                PageSize = Rotativa.Options.Size.A4,
                //FileName = RptName + "-" + DateTime.Now.ToShortDateString() + ".pdf" , contStatementReportPdf
                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\""
            });

            //}
        }
예제 #14
0
        public ActionResult TransWiseVat6P10RptPdf(DateTime fDate, DateTime tDate, string TransNo, string command)
        {
            List <Vat6P10> VchrLst_Ka  = new List <Vat6P10>();
            List <Vat6P10> VchrLst_Kha = new List <Vat6P10>();

            string sql = string.Format("EXEC VM_rpt6P10 '" + TransNo + "','','','','" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "','Ka' ");

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst_Ka = dbContext.Database.SqlQuery <Vat6P10>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt6P10 '" + TransNo + "','','','','" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "','Kha' ");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst_Kha = dbContext.Database.SqlQuery <Vat6P10>(sql).ToList();
            }
            Ka_KhaModel finalItem = new Ka_KhaModel();

            finalItem.VchrLst_Ka1  = VchrLst_Ka;
            finalItem.VchrLst_Kha1 = VchrLst_Kha;
            ViewBag.fDate          = InWord.GetAbbrMonthNameDate(fDate);
            ViewBag.tDate          = InWord.GetAbbrMonthNameDate(tDate);

            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            if (command == "Preview")
            {
                return(View(finalItem));
            }
            else
            {
                return(View("TransWiseVat6P10RptPdf - Copy", finalItem));
            }

            //return new Rotativa.ViewAsPdf("TransWiseVat6P10RptPdf", "", finalItem)
            //{
            //    //PageMargins= new Rotativa.Options.Margins(2,2,0,1),
            //    PageSize = Rotativa.Options.Size.A4, // (14f, 8.5f),
            //    // PageOrientation = Rotativa.AspNetCore.Options.Orientation.Landscape,
            //    PageOrientation = Rotativa.Options.Orientation.Portrait,

            //    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\""
            //};
        }
예제 #15
0
 public ActionResult GetAllDataForUserBranch()
 {
     try
     {
         string sql = string.Format("select *from Branch");
         IEnumerable <UserBranchWiseShow> userBranchLst;
         using (AcclineERPContext dbContext = new AcclineERPContext())
         {
             userBranchLst = dbContext.Database.SqlQuery <UserBranchWiseShow>(sql).ToList();
         }
         return(Json(new { data = userBranchLst }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception)
     {
         return(Json("0", JsonRequestBehavior.AllowGet));
     }
 }
예제 #16
0
 public ActionResult GetAllDataForSignatoryManagement()
 {
     try
     {
         string sql = string.Format("select * from FuncSL ");
         IEnumerable <signatoryManagementWiseShow> SMRawLst;
         using (AcclineERPContext dbContext = new AcclineERPContext())
         {
             SMRawLst = dbContext.Database.SqlQuery <signatoryManagementWiseShow>(sql).ToList();
         }
         return(Json(new { data = SMRawLst }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception)
     {
         return(Json("0", JsonRequestBehavior.AllowGet));
     }
 }
        public ActionResult GetDataForSelectedBranch(string BranchCode, string Accode)
        {
            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("Receive_Insert"))
            {
                return(Json("X", JsonRequestBehavior.AllowGet));
            }
            string             sql = string.Format("select *from AcBR where BranchCode='" + BranchCode + "'");
            IEnumerable <AcBR> BranchList;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                BranchList = dbContext.Database.SqlQuery <AcBR>(sql).ToList();
            }
            return(Json(BranchList, JsonRequestBehavior.AllowGet));
        }
예제 #18
0
        public JsonResult SaveMonthlyReturn(int year, int month, string projCode, string branchCode, string userName)
        {
            try
            {
                string sql = string.Format("exec VM_MonthlyReturn_Create '" + projCode + "','" + branchCode + "'," + year + "," + month + ",'" + userName + "'");
                IEnumerable <MonthlyReturn> MontlyReturnLst;
                using (AcclineERPContext dbContext = new AcclineERPContext())
                {
                    MontlyReturnLst = dbContext.Database.SqlQuery <MonthlyReturn>(sql).ToList();
                }

                return(Json("1", JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                return(Json("0", JsonRequestBehavior.AllowGet));
            }
        }
예제 #19
0
        public JsonResult Count_MRPrint(int year, int month)
        {
            try
            {
                string sql = string.Format("exec Count_MRPrint " + year + "," + month + "");
                IEnumerable <MonthlyReturn> MontlyReturnLst;
                using (AcclineERPContext dbContext = new AcclineERPContext())
                {
                    MontlyReturnLst = dbContext.Database.SqlQuery <MonthlyReturn>(sql).ToList();
                }

                return(Json("1", JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                return(Json("0", JsonRequestBehavior.AllowGet));
            }
        }
        public ActionResult DeleteMasterRecord(string Type, string DeleteID)
        {
            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("MasterInformation_Delete"))
            {
                return(Json("D", JsonRequestBehavior.AllowGet));
            }

            using (var transaction = new TransactionScope())
            {
                try
                {
                    //DeleteMemberImages(MemberId);
                    int DelStatus = 0;
                    using (AcclineERPContext dbContext = new AcclineERPContext())
                    {
                        var resultParameter = new SqlParameter("@Result", SqlDbType.Int)
                        {
                            Direction = ParameterDirection.Output
                        };

                        dbContext.Database.ExecuteSqlCommand("MasterRecordDelete @Type, @DeleteID, @Result out",
                                                             new SqlParameter("@Type", Type),
                                                             new SqlParameter("@DeleteID", DeleteID),
                                                             resultParameter);

                        DelStatus = (int)resultParameter.Value;

                        TransactionLogService.SaveTransactionLog(_transactionLogService, "MasterInformation", "Delete",
                                                                 string.Empty, Session["UserName"].ToString());
                    }

                    transaction.Complete();

                    return(Json(DelStatus, JsonRequestBehavior.AllowGet));
                }
                catch (Exception)
                {
                    transaction.Dispose();
                    return(Json("0", JsonRequestBehavior.AllowGet));
                }
            }
        }
예제 #21
0
        public ActionResult TransWiseVat9P1_SF_Ka_2_RptPdf(string Project, string Branch, DateTime fDate, DateTime tDate, string Year, string Month, string FinYear, string command)
        {
            FinYear = Session["FinYear"].ToString();
            string sql = string.Format("EXEC VM_rpt9P1_SF_Ka_2 '" + Project + "', '" + Branch + "', '" + FinYear + "', '" + Year + "', '" + Month + "','" + fDate.ToString("yyyy/MM/dd") + "', '" + tDate.ToString("yyyy/MM/dd") + "',''");
            IEnumerable <Vat9P1_SF_Ka> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <Vat9P1_SF_Ka>(sql).ToList();
            }
            if (command == "Preview")
            {
                return(View("rptVat9P1_SF_Ka_2_RptPdf", VchrLst));
            }
            else
            {
                return(View("rptVat9P1_SF_Ka_2_RptPdfPrint", VchrLst));
            }
        }
예제 #22
0
        public ActionResult GetDataForSelectedUserName(string UserName)
        {
            try
            {
                // select * from EmployeeFunc where UserID = (select id from Employee where UserName = '******' )
                string sql = string.Format("select * from EmployeeFunc where EmpId = (select Id from Employee where UserName = '******')");
                IEnumerable <EmployeeFunc> EmployeeList;

                using (AcclineERPContext dbContext = new AcclineERPContext())
                {
                    EmployeeList = dbContext.Database.SqlQuery <EmployeeFunc>(sql).ToList();
                }
                return(Json(EmployeeList, JsonRequestBehavior.AllowGet));
            }
            catch (Exception)
            {
                return(Json("0", JsonRequestBehavior.AllowGet));
            }
        }
예제 #23
0
        public ActionResult GetDataForSelectedUserBranch(int UserID)
        {
            try
            {
                // select * from EmployeeFunc where UserID = (select id from Employee where UserName = '******' )
                string sql = string.Format("select * from UserBranch where Userid ='" + UserID + "'");
                IEnumerable <UserBranch> userBranchList;

                using (AcclineERPContext dbContext = new AcclineERPContext())
                {
                    userBranchList = dbContext.Database.SqlQuery <UserBranch>(sql).ToList();
                }
                return(Json(userBranchList, JsonRequestBehavior.AllowGet));
            }
            catch (Exception)
            {
                return(Json("0", JsonRequestBehavior.AllowGet));
            }
        }
        public ActionResult GetAllDataForAllBranch()
        {
            //RBACUser rUser = new RBACUser(Session["UserName"].ToString());
            //if (!rUser.HasPermission("Receive_Insert"))
            //{
            //    return Json("X", JsonRequestBehavior.AllowGet);
            //}
            var    Bills = default(dynamic);
            var    gset  = _GsetService.All().FirstOrDefault();
            string sql   = string.Format("select  Accode,AcName,BranchCode,'Cash' as AccType from NewChart where Accode LIKE ('" + gset.GCa + "%')  Union select  Accode ,AcName,BranchCode,'Bank' as AccType from NewChart where( Accode LIKE ('" + gset.GBa + "%'))");
            //  string sql = string.Format("select *from NewChart");
            IEnumerable <branchWiseShow> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <branchWiseShow>(sql).ToList();
                Bills   = VchrLst;
            }
            return(Json(new { data = Bills }, JsonRequestBehavior.AllowGet));
        }
        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\""
            });
        }
예제 #26
0
        public ActionResult TransWiseVat6P2P1RptPdf(DateTime fDate, DateTime tDate, string TransNo, string FinYear, string command)
        {
            string sql = string.Format("EXEC VM_rpt6P2P1 '" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "','" + TransNo + "', '" + FinYear + "'");
            IEnumerable <VatStatementVM> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <VatStatementVM>(sql).ToList();
            }

            ViewBag.fDate = InWord.GetAbbrMonthNameDate(fDate);
            ViewBag.tDate = InWord.GetAbbrMonthNameDate(tDate);

            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            if (command == "Preview")
            {
                return(View("rptVat6P2P1Pdf", VchrLst));
            }
            else
            {
                return(View("rptVat6P2P1Pdf", VchrLst));
            }

            //return new Rotativa.ViewAsPdf("rptVat6P2P1Pdf", "", VchrLst)
            //{
            //    //PageMargins= new Rotativa.Options.Margins(2,2,0,1),
            //    PageSize = Rotativa.Options.Size.A4, // (14f, 8.5f),
            //    // PageOrientation = Rotativa.AspNetCore.Options.Orientation.Landscape,
            //    PageOrientation = Rotativa.Options.Orientation.Landscape,

            //    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\""
            //};
        }
예제 #27
0
        //protected void Application_Start()
        //{

        //    AreaRegistration.RegisterAllAreas();

        //    WebApiConfig.Register(GlobalConfiguration.Configuration);
        //    FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
        //    RouteConfig.RegisterRoutes(RouteTable.Routes);
        //    BundleConfig.RegisterBundles(BundleTable.Bundles);
        //    AuthConfig.RegisterAuth();

        //}
        protected void Application_Start()
        {
            //Database.SetInitializer(new MigrateDatabaseToLatestVersion<SCAppContext, System.Data.Entity.Migrations.DbMigrationsConfiguration<SCAppContext>>("DefaultConnection"));
            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterAuth();
            using (var context = new AcclineERPContext())
            {
                if (!context.Database.Exists())
                {
                    // Register the SimpleMembership database without Entity Framework migration schema
                    //((IObjectContextAdapter)context).ObjectContext.CreateDatabase();
                    context.Database.Create();
                }
                context.Database.Initialize(true);
                //context.Database.Delete();
                //context.Database.Create();
            }
            string url = ""; //HttpContext.Current.Request.Url.AbsoluteUri;

            //string url = HttpContext.Current.Request.Url.Authority;
            //if (url == "ntcgarden.accline.com")
            //{
            WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "Username", autoCreateTables: true);
            //}
            //else if (url == "ntctest.accline.com")
            //{
            //    WebSecurity.InitializeDatabaseConnection("testConnection", "UserProfile", "UserId", "Username", autoCreateTables: true);
            //}
            //else
            //{
            //    WebSecurity.InitializeDatabaseConnection("testConnection", "UserProfile", "UserId", "Username", autoCreateTables: true);
            //}
        }
예제 #28
0
        private void GetDatabaseUserRolesPermissions()
        {
            using (AcclineERPContext _data = new AcclineERPContext())
            {
                SecUserInfo _user = _data.SecUserInfo.Where(u => u.UserName == this.UserName).FirstOrDefault();
                if (_user != null)
                {
                    this.UserID = _user.UserID;
                    foreach (SecUserInGroup _group in _user.SecUserInGroups)
                    {
                        SecUserGroup _uGroup = _data.SecUserGroup.Where(u => u.GroupID == _group.GroupID).FirstOrDefault();

                        UserRole _userRole = new UserRole {
                            Role_Id = _group.GroupID, RoleName = _uGroup.GroupName
                        };

                        List <SecFormRight> _fRightList = _data.SecFormRight.Where(u => u.GroupID == _group.GroupID).ToList();

                        foreach (SecFormRight _fRight in _fRightList)
                        {
                            SecFormProcess _fproc  = _data.SecFormProcess.Where(u => u.FormProcessID == _fRight.FormProcessID).FirstOrDefault();
                            SecFormList    _frmLst = _data.SecFormList.Where(u => u.FormID == _fproc.FormID).FirstOrDefault();

                            _userRole.Permissions.Add(new RolePermission {
                                FormName = _frmLst.FormName, PermissionName = _fproc.ProcessName
                            });
                        }
                        this.Roles.Add(_userRole);

                        //if (!this.IsSysAdmin)
                        //    this.IsSysAdmin = _group.IsSysAdmin;
                    }
                }
            }

            //}
        }
예제 #29
0
        public ActionResult TransWiseVat6P3RptPdf(string TransNo, string FinYear, string command)
        {//VM_rpt6P3 '','','','2019-20'
            string sql = string.Format("EXEC VM_rpt6P3 '" + TransNo + "','','', '" + FinYear + "'");
            IEnumerable <Vat6_3> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <Vat6_3>(sql).ToList();
            }

            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            if (command == "Preview")
            {
                return(View("rptVat6P3Pdf", VchrLst));
            }
            else
            {
                return(View("rptVat6P3Pdf - Copy", VchrLst));
            }

            //return new Rotativa.ViewAsPdf("rptVat6P3Pdf", "", VchrLst)
            //{
            //    //PageMargins= new Rotativa.Options.Margins(1,1,1,1),
            //    PageSize = Rotativa.Options.Size.A4,
            //    PageOrientation = Rotativa.Options.Orientation.Landscape,
            //    //PageOrientation = Rotativa.Options.Orientation.Landscape,
            //    //PageSize = Rotativa.Options.Size.Legal,
            //    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\""
            //};
        }
예제 #30
0
        public ActionResult Vat4P3RptPdf(string DeclarationNo, string command, string ItemCode)
        {
            string sql = string.Format("EXEC VM_rpt4P3 '" + DeclarationNo + "','" + ItemCode + "'");
            IEnumerable <App.Domain.ViewModel.VM_4P3> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <VM_4P3>(sql).ToList();
            }
            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;
            if (command == "Preview")
            {
                return(View("rptVat4P3Pdf", VchrLst));
            }
            else
            {
                return(View("rptVat4P3Pdf", VchrLst));
            }
        }