Ejemplo n.º 1
0
        public ActionResult Index(VIEW_DCR_SHEET_Search obj)
        {
            SEC_USERS_LOGIN_Result1 user = Session["sess_sec_users"] as SEC_USERS_LOGIN_Result1;

            if ((user != null) && (user.USER_TYPE_NO == (decimal)UserType.Zonal_Manager))
            {
                obj.USER_NO = user.USER_NO;
            }

            SEC_USERS_ZM_LOGIN_GET_Result user_result = db.SEC_USERS_ZM_LOGIN_GET(null, null, obj.USER_NO, null).FirstOrDefault();


            List <TRN_DCR_SHEET_SUM_Result> dcr_sum_result = db.TRN_DCR_SHEET_SUM(obj.USER_NO, obj.TRN_DCR_DATE).ToList();

            foreach (var dcr in dcr_sum_result)
            {
                dcr.TRN_DCR_SHEET_DET_List = db.TRN_DCR_SHEET_DET(dcr.DCR_NO).ToList();
            }

            List <TRN_EXPENSE_SUM_Result> exp_result = db.TRN_EXPENSE_SUM(obj.USER_NO, obj.TRN_DCR_DATE).ToList();

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

            ViewBag.Is_ZonalOrAgent = Is_ZonalOrAgent;

            ViewBag.TRN_DCR_DATE   = obj.TRN_DCR_DATE;
            ViewBag.user_result    = user_result;
            ViewBag.dcr_sum_result = dcr_sum_result;
            ViewBag.exp_result     = exp_result;

            return(View("DcrSheet"));
        }