コード例 #1
0
        public ActionResult BlockListCard(FormCollection collection)
        {
            if (Request.IsAuthenticated)
            {
                try
                {
                    string   msg;
                    STCardVP param;
                    if (Session["CARDPARAM"] != null)
                    {
                        param = (STCardVP)Session["CARDPARAM"];
                    }
                    else
                    {
                        param = new STCardVP();
                    }
                    //  Session["CARDPARAM"] = param;
                    if (!CardModelsRepository.Instance.BlockListCard(param, out msg))
                    {
                        ViewData["MSG"] = msg;
                    }
                    else
                    {
                        ViewData["MSG"] = "Cards is successfully blocked";
                    }

                    return(View());
                }
                catch { return(View()); }
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
コード例 #2
0
        // public static STCardVP param;

        //
        // GET: /Card/


        public ActionResult List(int pageNum = 0)
        {
            if (Request.IsAuthenticated)
            {
                CUser  clUser = new CUser(LocalData.UserId(), LocalData.CSDbUsers(), LocalData.LogPath());
                STUser stUser;
                string msg;
                clUser.GetRecordByUserId(LocalData.UserId(), out stUser, out msg);
                if (!stUser.oldpass)
                {
                    STCardVP param;
                    if (Session["CARDPARAM"] != null)
                    {
                        param = (STCardVP)Session["CARDPARAM"];
                    }
                    else
                    {
                        param = new STCardVP();
                    }

                    if (!SharedModel.IsConnect(LocalData.CSDbCards1(), out msg) && !SharedModel.IsConnect(LocalData.CSDbCards2(), out msg))
                    {
                        ViewData["ERROR"] = "No connection to DB";
                        ViewData["MSG"]   = msg;

                        //return RedirectToAction("Index", "Error");
                        return(View("Index"));
                    }
                    else
                    {
                        string[] arr = new[] { "'", "\"", "--" };
                        if (CheckerField.CheckField(arr, param.maskaccount, param.maskedcompanyname, param.maskeddrivername, param.maskedemail, param.maskedpan, param.maskedvrn,
                                                    param.masksubaccount, param.expdate))
                        {
                            ViewData["MSG"] = "One or more fields contain invalid characters.";
                            return(View("Errors1"));
                        }
                        else
                        {
                            List <CardModels> lst = CardModelsRepository.Instance.GetListCard(param);
                            ViewData["PageNum"]    = pageNum;
                            ViewData["ItemsCount"] = lst.Count;
                            ViewData["PageSize"]   = pageSize;
                            ViewData["STRPARAM"]   = param.strdata;

                            return(View(CardModelsRepository.Instance.GetListCard(pageSize, pageNum, param)));
                        }
                    }
                }
                else
                {
                    return(RedirectToAction("ChangePassword", "Account"));
                }
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
コード例 #3
0
        public ActionResult Filter(CardModelsViewParam prm, FormCollection collection)
        {
            if (Request.IsAuthenticated)
            {
                try
                {
                    STCardVP param = CardModelsRepository.Instance.GetParam(prm);
                    Session["CARDPARAM"] = param;

                    return(RedirectToAction("List"));
                }
                catch { return(View()); }
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
コード例 #4
0
        public ActionResult Clearfilter()
        {
            if (Request.IsAuthenticated)
            {
                STCardVP param = new STCardVP();
                Session["CARDPARAM"] = param;
                try
                {
                    //   STUser user = UserModelsRepository.Instance.GetLocalUser();

                    // LocaParam.SetParam(null);
                    return(RedirectToAction("List"));
                }
                catch { return(View(param)); }
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
コード例 #5
0
 public ActionResult Filter()
 {
     if (Request.IsAuthenticated)
     {
         //STCardVP param = LocaParam.cardparam;
         STCardVP param;
         if (Session["CARDPARAM"] != null)
         {
             param = (STCardVP)Session["CARDPARAM"];
         }
         else
         {
             param = new STCardVP();
         }
         CardModelsViewParam prm = CardModelsRepository.Instance.SetParam(param);
         return(View("Filter", prm));
     }
     else
     {
         return(RedirectToAction("Index", "Home"));
     }
 }
コード例 #6
0
ファイル: LocalData.cs プロジェクト: Pavlo7/AEVIProject
 public static void SetParam(STCardVP param)
 {
     cardparam = param;
 }