Esempio n. 1
0
        // GET: WrittenOff
        public ActionResult Index()
        {
            DataTable dt           = new DataTable();
            DataTable dt_main_menu = new DataTable();
            DataTable dtwrittenoff = new DataTable();

            mutility.DbName     = Settings.Default["DbName"].ToString();
            mutility.UserName   = Settings.Default["UserName"].ToString();
            mutility.Password   = Settings.Default["Password"].ToString();
            mutility.ServerName = Settings.Default["ServerName"].ToString();
            if (mutility.ServerName == "" || mutility.DbName == "" || mutility.UserName == "")
            {
                return(RedirectToAction("Index", "Setting_Connection/Index"));
            }
            else
            {
                if (Session["ID"] != null)
                {
                    UserAccessRightController UsAccRight = new UserAccessRightController();
                    string sql = "select row_number() over(order by BrCode) as id,* from dbo.Rep_WrittenOff  where reportdate='2019-04-30'  order by BrCode ASC";
                    dtwrittenoff = wo.Write_Off(sql);
                    string userkey = Session["user_key"].ToString();
                    dt                  = UsAccRight.UserAccessRight(userkey);
                    dt_main_menu        = UsAccRight.Main_Menu(userkey);
                    ViewBag.manin_menu  = dt_main_menu;
                    ViewBag.sub_manin   = dt;
                    ViewBag.writtenoff  = dtwrittenoff;
                    ViewBag.CurrRunDate = CurrRunDate.CurrRunDate(userkey);
                    return(View());
                }
                else
                {
                    return(RedirectToAction("Index", "Login/Index"));
                }
            }
        }
Esempio n. 2
0
        public ActionResult SearchReportWrittenOffCompare(WriteOff wo)
        {
            DataTable dt            = new DataTable();
            DataTable dt_main_menu  = new DataTable();
            DataTable dtwrittenoff  = new DataTable();
            DataTable dtColumnTitle = new DataTable();

            mutility.DbName     = Settings.Default["DbName"].ToString();
            mutility.UserName   = Settings.Default["UserName"].ToString();
            mutility.Password   = Settings.Default["Password"].ToString();
            mutility.ServerName = Settings.Default["ServerName"].ToString();
            if (mutility.ServerName == "" || mutility.DbName == "" || mutility.UserName == "")
            {
                return(RedirectToAction("Index", "Setting_Connection/Index"));
            }
            else
            {
                if (Session["ID"] != null)
                {
                    UserAccessRightController UsAccRight = new UserAccessRightController();
                    string sql = "select row_number() over(order by BrCode) as id,* from Rep_WrittenOffMBWIN  where  reportdate='" + String.Format("{0:yyyy-MM-dd}", wo.date_start) + @"'  order by BrCode ASC";
                    dtwrittenoff = wo.Write_Off(sql);
                    string userkey = Session["user_key"].ToString();
                    dt                  = UsAccRight.UserAccessRight(userkey);
                    dt_main_menu        = UsAccRight.Main_Menu(userkey);
                    ViewBag.manin_menu  = dt_main_menu;
                    ViewBag.sub_manin   = dt;
                    ViewBag.writtenoff  = dtwrittenoff;
                    ViewBag.date_start  = wo.date_start;
                    ViewBag.ColumnTitle = dtColumnTitle;
                    ViewBag.CurrRunDate = CurrRunDate.CurrRunDate(userkey);
                    return(View("GlComTool"));
                }
                else
                {
                    return(RedirectToAction("Index", "Login/Index"));
                }
            }
        }