//
        // GET: /OfflineExpenseCheck/

        public ActionResult Index()
        {
            SearchOfflineExpense dcrSearch = (Session["SearchOfflineExpense"] == null) ? new SearchOfflineExpense()
                : (SearchOfflineExpense)Session["SearchOfflineExpense"];

            ViewBag.dcrSearch     = dcrSearch;
            ViewBag.ZonalUsers    = db.SEC_USERS.Where(u => u.GEN_USER_TYPES.SHORT_NAME == "ZM");
            ViewBag.fromDate      = DateTime.Now.ToString("yyyy-MM-dd");
            ViewBag.toDate        = DateTime.Now.AddDays(60).ToString("yyyy-MM-dd");
            ViewBag.trnasType     = db.SET_TRANSPORT_TYPE.ToList();
            ViewBag.verify_status = new SelectList(db.GEN_APPROVE_TYPE, "APPROVE_TYPE_NO", "APPROVE_TYPE");
            ViewBag.ddldivision   = new SelectList(db.SET_DIVISION, "DIVISION_NO", "DIVISION_NAME");
            ViewBag.Search_User   = new SelectList(db.SEC_USERS_GET_RPT_ZONAL(decimal.Parse(Session["sess_USER_NO"].ToString()),
                                                                              null, null, null).ToList(), "USER_NO", "USER_FULL_NAME");
            //error in this
            IList <TRN_EXPENSE_APPROVAL_GET_Result> tmp = db.TRN_EXPENSE_APPROVAL_GET(
                null,                                              //user
                decimal.Parse(Session["sess_USER_NO"].ToString()), //parent
                null,                                              //division
                null,                                              //zilla
                null,                                              //thana
                DateTime.Now,                                      //date from
                DateTime.Now,                                      //date to
                0,
                0, null).ToList();

            ViewBag.expenses = tmp;

            decimal?dcr_count = db.TRN_EXPENSE_VERIFY_COUNT(decimal.Parse(Session["sess_USER_NO"].ToString())).FirstOrDefault().CNT;

            ViewBag.dcr_count = dcr_count;

            return(View());
        }
Ejemplo n.º 2
0
        //
        // GET: /OfflineEntryMonitor/
        //public Tuple<SearchOfflineEntry, IQueryable<TRN_DCR>> setSearch(IQueryable<TRN_DCR> dcrs, SearchOfflineEntry dcrSearch, bool search)
        //{
        //    dcrSearch = (dcrSearch.dirty) ? dcrSearch : new SearchOfflineEntry();

        //    if (!string.IsNullOrEmpty(Request.QueryString["USER_NO"]) || search)
        //    {
        //        dcrSearch.USER_NO = (!search) ? decimal.Parse(Request.QueryString["USER_NO"].ToString()) : dcrSearch.USER_NO;
        //        if (!string.IsNullOrEmpty(dcrSearch.USER_NO.ToString()))
        //            dcrs = dcrs.Where(s => s.USER_NO == dcrSearch.USER_NO);
        //    }
        //    else
        //        dcrSearch.USER_NO = null;

        //    if (!string.IsNullOrEmpty(Request.QueryString["DateFrom"]) || search)
        //    {
        //        dcrSearch.dateOffFrom = (!search) ? DateTime.Parse(Request.QueryString["DateFrom"]) : dcrSearch.dateOffFrom;
        //        if (dcrSearch.dateOffFrom != null)
        //            dcrs = dcrs.Where(s => s.TRN_DCR_DATE > dcrSearch.dateOffFrom);
        //    }
        //    else
        //        dcrSearch.dateOffFrom = null;
        //    if (!string.IsNullOrEmpty(Request.QueryString["DateTo"]) || search)
        //    {
        //        dcrSearch.dateOffTo = (!search) ? DateTime.Parse(Request.QueryString["DateTo"]) : dcrSearch.dateOffTo;
        //        if (dcrSearch.dateOffTo != null)
        //            dcrs = dcrs.Where(s => s.TRN_DCR_DATE < dcrSearch.dateOffTo);
        //    }
        //    else
        //        dcrSearch.dateOffTo = null;

        //    if (!string.IsNullOrEmpty(Request.QueryString["dcrType"]) || search)
        //    {
        //        dcrSearch.dcrType = (!search) ? decimal.Parse( Request.QueryString["dcrType"]) : dcrSearch.dcrType;
        //        if (!string.IsNullOrEmpty(dcrSearch.dcrType.ToString()))
        //            dcrs = dcrs.Where(s => s.DCR_TYPE_NO== dcrSearch.dcrType);
        //    }
        //    else
        //        dcrSearch.dcrType = null;
        //    if (!string.IsNullOrEmpty(Request.QueryString["verify"]) || search)
        //    {
        //        dcrSearch.verify = (!search) ? decimal.Parse(Request.QueryString["verify"]) : dcrSearch.verify;
        //        if (!string.IsNullOrEmpty(dcrSearch.verify.ToString()))
        //            dcrs = dcrs.Where(s => s.APPROVE_TYPE_NO == dcrSearch.verify);
        //    }
        //    else
        //        dcrSearch.verify = null;
        //    dcrSearch.dirty = true;
        //    return new Tuple<SearchOfflineEntry, IQueryable<TRN_DCR>>(dcrSearch, dcrs);
        //}
        public ActionResult Index()
        {
            /**
             * viewbag config for searching only
             * */
            ViewBag.ZonalUsers = db.SEC_USERS.Where(u => u.GEN_USER_TYPES.SHORT_NAME == "ZM");
            ViewBag.fromDate   = DateTime.Now.ToString("yyyy-MM-dd");
            ViewBag.toDate     = DateTime.Now.AddDays(60).ToString("yyyy-MM-dd");
            SearchOfflineEntry dcrSearch = (Session["SearchOfflineEntry"] == null) ? new SearchOfflineEntry()
                : (SearchOfflineEntry)Session["SearchOfflineEntry"];

            Session["DCRSearch"]  = dcrSearch;
            ViewBag.dcrSearch     = dcrSearch;
            ViewBag.dcrType       = new SelectList(db.GEN_DCR_TYPE, "DCR_TYPE_NO", "DCR_TYPE");
            ViewBag.verify_status = new SelectList(db.GEN_APPROVE_TYPE, "APPROVE_TYPE_NO", "APPROVE_TYPE");
            ViewBag.ddldivision   = new SelectList(db.SET_DIVISION, "DIVISION_NO", "DIVISION_NAME");
            ViewBag.zmusers       = new SelectList(db.SEC_USERS_GET_RPT_ZONAL(decimal.Parse(Session["sess_USER_NO"].ToString()), null, null, null).ToList(),
                                                   "USER_NO", "USER_FULL_NAME");
            ViewBag.trnasType = db.SET_TRANSPORT_TYPE.ToList();

            /**
             * proc call to get all unverified data
             * */
            List <TRN_DCR_OFF_VERIFY_GET_Result> dcr_List = db.TRN_DCR_OFF_VERIFY_GET(dcrSearch.dcrType, //dcr type
                                                                                      null,              //user no
                                                                                      decimal.Parse(Session["sess_USER_NO"].ToString()),
                                                                                      null,              //division
                                                                                      null,              //zilla
                                                                                      null,              //thana
                                                                                      DateTime.Now,      //date to
                                                                                      DateTime.Now,      //date from
                                                                                      0).ToList();

            ViewBag.dcr_List = dcr_List;

            decimal?dcr_count = db.TRN_DCR_OFF_VERIFY_COUNT(decimal.Parse(Session["sess_USER_NO"].ToString())).FirstOrDefault();

            ViewBag.dcr_count = dcr_count;

            return(View());
        }
Ejemplo n.º 3
0
        public ActionResult Reset()
        {
            ObjectResult <DOWNLOAD_RESET_ZONAL_GET_Result> zonals = null;
            UpDownSearchModel model = null;

            decimal?USER_NO = decimal.Parse(Session["sess_USER_NO"].ToString());

            ViewBag.Search_Division = new SelectList(db.SET_DIVISION, "DIVISION_NO", "DIVISION_NAME");
            ViewBag.Search_User     = new SelectList(db.SEC_USERS_GET_RPT_ZONAL(USER_NO, null, null, null).ToList(),
                                                     "USER_NO", "USER_FULL_NAME");

            if (Request.QueryString.HasKeys())
            {
                model = new UpDownSearchModel();
                if (!string.IsNullOrEmpty(Request.QueryString["Search_Division"]) &&
                    decimal.Parse(Request.QueryString["Search_Division"]) != 0)
                {
                    model.Search_Division = decimal.Parse(Request.QueryString["Search_Division"]);
                }

                if (!string.IsNullOrEmpty(Request.QueryString["Search_Zilla"]) &&
                    decimal.Parse(Request.QueryString["Search_Zilla"]) != 0)
                {
                    model.Search_Zilla = decimal.Parse(Request.QueryString["Search_Zilla"]);
                }

                if (!string.IsNullOrEmpty(Request.QueryString["Search_Thana"]) &&
                    decimal.Parse(Request.QueryString["Search_Thana"]) != 0)
                {
                    model.Search_Thana = decimal.Parse(Request.QueryString["Search_Thana"]);
                }

                if (!string.IsNullOrEmpty(Request.QueryString["Search_User"]) &&
                    decimal.Parse(Request.QueryString["Search_User"]) != 0)
                {
                    model.Search_User = decimal.Parse(Request.QueryString["Search_User"]);
                }

                if (!string.IsNullOrEmpty(Request.QueryString["Search_To"]))
                {
                    model.Search_To = DateTime.Parse(Request.QueryString["Search_To"]);
                }



                zonals = db.DOWNLOAD_RESET_ZONAL_GET(USER_NO, model.Search_User, model.Search_Division,
                                                     model.Search_Zilla, model.Search_Thana);
            }

            ViewBag.Search_Model = model;

            return(View(zonals));
        }
Ejemplo n.º 4
0
        public ActionResult Index()
        {
            ViewBag.ZonalUsers    = db.SEC_USERS.Where(u => u.GEN_USER_TYPES.SHORT_NAME == "ZM");
            ViewBag.fromDate      = DateTime.Now.ToString("yyyy-MM-dd");
            ViewBag.toDate        = DateTime.Now.AddDays(60).ToString("yyyy-MM-dd");
            ViewBag.trnasType     = db.SET_TRANSPORT_TYPE.ToList();
            ViewBag.verify_status = new SelectList(db.GEN_APPROVE_TYPE, "APPROVE_TYPE_NO", "APPROVE_TYPE");
            ViewBag.ddldivision   = new SelectList(db.SET_DIVISION, "DIVISION_NO", "DIVISION_NAME");
            ViewBag.zmusers       = new SelectList(db.SEC_USERS_GET_RPT_ZONAL(decimal.Parse(Session["sess_USER_NO"].ToString()),
                                                                              null, null, null).ToList(), "USER_NO", "USER_FULL_NAME");

            IList <TRN_GET_ALL_COST_Result> result = db.TRN_GET_ALL_COST(null, decimal.Parse(Session["sess_USER_NO"].ToString()),//parent
                                                                         null, null, null, DateTime.Today, DateTime.Today).ToList();

            ViewBag.result = result;


            return(View());
        }
Ejemplo n.º 5
0
        public ActionResult CostAmmendment()
        {
            SearchDCRCostApproval dcrSearch = (Session["SearchDCRCostApproval"] == null) ? new SearchDCRCostApproval()
                : (SearchDCRCostApproval)Session["SearchDCRCostApproval"];

            ViewBag.dcrSearch     = dcrSearch;
            ViewBag.ZonalUsers    = db.SEC_USERS.Where(u => u.GEN_USER_TYPES.SHORT_NAME == "ZM");
            ViewBag.fromDate      = DateTime.Now.ToString("yyyy-MM-dd");
            ViewBag.toDate        = DateTime.Now.ToString("yyyy-MM-dd");
            ViewBag.trnasType     = db.SET_TRANSPORT_TYPE.ToList();
            ViewBag.verify_status = new SelectList(db.GEN_APPROVE_TYPE, "APPROVE_TYPE_NO", "APPROVE_TYPE");
            ViewBag.ddldivision   = new SelectList(db.SET_DIVISION, "DIVISION_NO", "DIVISION_NAME");
            ViewBag.zmusers       = new SelectList(db.SEC_USERS_GET_RPT_ZONAL(decimal.Parse(Session["sess_USER_NO"].ToString()),
                                                                              null, null, null).ToList(), "USER_NO", "USER_FULL_NAME");
            //error in this
            IList <TRN_EXPENSE_APPROVAL_GET_Result> tmp = db.TRN_EXPENSE_APPROVAL_GET(
                null,                                              //user
                decimal.Parse(Session["sess_USER_NO"].ToString()), //parent
                null,                                              //division
                null,                                              //zilla
                null,                                              //thana
                DateTime.Now,                                      //date from
                DateTime.Now,                                      //date to
                0, 1, null).ToList();

            ViewBag.expenses = tmp;

            List <TRN_DCR_APPROVAL_GET_Result> dcr_List = db.TRN_DCR_APPROVAL_GET(dcrSearch.dcrType, //dcr type
                                                                                  null,              //user no
                                                                                  decimal.Parse(Session["sess_USER_NO"].ToString()),
                                                                                  null,              //division
                                                                                  null,              //zilla
                                                                                  null,              //thana
                                                                                  DateTime.Now,      //date to
                                                                                  DateTime.Now,      //date from
                                                                                  0, null).ToList();

            ViewBag.dcr_List = dcr_List;

            decimal?dcr_count = db.TRN_DCR_APPROVAL_COUNT(decimal.Parse(Session["sess_USER_NO"].ToString())).FirstOrDefault();

            ViewBag.dcr_count = dcr_count;

            return(View());
        }
Ejemplo n.º 6
0
        public ActionResult DcrPublish()
        {
            DcrPublishSearchModel searchModel     = new DcrPublishSearchModel();
            DcrPublishViewModel   dcrPublishModel = new DcrPublishViewModel();

            decimal?USER_NO = Session["sess_USER_NO"] as decimal?;

            ViewBag.Search_Division = new SelectList(db.SET_DIVISION, "DIVISION_NO", "DIVISION_NAME");
            ViewBag.Search_User     = new SelectList(db.SEC_USERS_GET_RPT_ZONAL(USER_NO,
                                                                                null, null, null).ToList(), "USER_NO", "USER_FULL_NAME");

            bool Is_ZonalOrAgent = (bool)Session["sess_Is_ZonalOrAgent"];

            ViewBag.Is_ZonalOrAgent = Is_ZonalOrAgent;

            string Search_User = Request.QueryString["Search_User"];

            if (string.IsNullOrEmpty(Search_User))
            {
                Search_User = Request.QueryString["USER_NO"];
            }

            if (Is_ZonalOrAgent)
            {
                Search_User = Session["sess_USER_NO"].ToString();
            }

            if (!string.IsNullOrEmpty(Request.QueryString["Search"]))
            {
                searchModel.Search_User = decimal.Parse(Search_User);
                ViewBag.Search_User     = new SelectList(db.SEC_USERS_GET_RPT_ZONAL(decimal.Parse(Session["sess_USER_NO"].ToString()),
                                                                                    null, null, null).ToList(), "USER_NO", "USER_FULL_NAME", searchModel.Search_User);

                SEC_USERS user = db.SEC_USERS.Single(u => u.USER_NO == searchModel.Search_User);

                if (!string.IsNullOrEmpty(Request.QueryString["Search_Date_From"]))
                {
                    searchModel.Search_Date_From = DateTime.Parse(Request.QueryString["Search_Date_From"]);
                }
                else
                {
                    DateTime now             = DateTime.Now;
                    DateTime FirstDayOfMonth = new DateTime(now.Year, now.Month, 1);
                    searchModel.Search_Date_From = FirstDayOfMonth;
                }
                if (!string.IsNullOrEmpty(Request.QueryString["Search_Date_To"]))
                {
                    searchModel.Search_Date_To = DateTime.Parse(Request.QueryString["Search_Date_To"]);
                }
                else
                {
                    searchModel.Search_Date_To = DateTime.Now;
                }

                List <DCR_PUB_EXP_GET_Result> expense =
                    db.DCR_PUB_EXP_GET(searchModel.Search_User, null,
                                       searchModel.Search_Date_From, searchModel.Search_Date_To, 0).ToList();

                List <DCR_PUB_SPECIMEN_GET_Result> specimen =
                    db.DCR_PUB_SPECIMEN_GET(searchModel.Search_User, null,
                                            searchModel.Search_Date_From, searchModel.Search_Date_To, 0).ToList();

                dcrPublishModel.expenses         = new DcrExpenseModel();
                dcrPublishModel.expenses.user    = user;
                dcrPublishModel.expenses.date    = DateTime.Now;
                dcrPublishModel.expenses.expense = expense;

                dcrPublishModel.specimens          = new DcrSpecimenModel();
                dcrPublishModel.specimens.user     = user;
                dcrPublishModel.specimens.date     = DateTime.Now;
                dcrPublishModel.specimens.specimen = specimen;

                if (!string.IsNullOrEmpty(Request.QueryString["Print"]))
                {
                    string print = Request.QueryString["Print"];
                    dcrPublishModel.details = new List <DcrDetailsModel>();

                    if (print.Length > 0 && print == "Y")
                    {
                        dcrPublishModel.expenses.date  = searchModel.Search_Date_From;
                        dcrPublishModel.specimens.date = searchModel.Search_Date_From;

                        for (DateTime?date = searchModel.Search_Date_From;
                             date <= searchModel.Search_Date_To; date = date.Value.AddDays(1))
                        {
                            DcrDetailsModel dcrDetails = new DcrDetailsModel();

                            List <DCR_PUB_DCR_DETAIL_GET_Result> detail =
                                db.DCR_PUB_DCR_DETAIL_GET(searchModel.Search_User, null, date, date, 0).ToList();

                            List <TRN_EXPENSE_APPROVAL_GET_Result> detailexpense =
                                db.TRN_EXPENSE_APPROVAL_GET(
                                    searchModel.Search_User, decimal.Parse(Session["sess_USER_NO"].ToString()),//parent
                                    null, null, null, date, date, 1, 1, null).ToList();

                            dcrDetails.date    = date;
                            dcrDetails.expense = detailexpense;
                            dcrDetails.detail  = detail;

                            dcrPublishModel.details.Add(dcrDetails);
                        }
                    }

                    ViewBag.Print = print;

                    return(PartialView("_DcrPublishPrint", dcrPublishModel));
                }

                ViewBag.Search_DcrPublish_Model = searchModel;

                Session["sess_Search_DcrPublish_Model"] = searchModel;

                return(View(dcrPublishModel));
            }

            return(View());
        }