Example #1
0
        public List <EventModels> GetListEvent(STEventVP param)
        {
            List <EventModels> ret = new List <EventModels>();
            EventModels        item;

            List <STEvent> data = new List <STEvent>();
            string         msg;

            CEvent clEvent = new CEvent(LocalData.UserId(), LocalData.CSDbCards1(), LocalData.CSDbCards2(),
                                        LocalData.LogPath());

            try
            {
                int retvalue = clEvent.GetData(param, out data, out msg);

                foreach (STEvent row in data)
                {
                    item = new EventModels();

                    item.IfsfCode  = row.ifsfcode;
                    item.Country   = row.country;
                    item.Pan       = row.maskedpan;
                    item.LocalTime = row.ltime.ToString("yyyy-MM-dd HH:mm:ss");
                    item.ProcCode  = row.proccode;
                    item.Text      = row.text;
                    item.UTDCode   = row.utdcode;
                    item.Msg       = row.msg;

                    ret.Add(item);
                }
            }
            catch (Exception ex) { msg = ex.Message; }
            return(ret);
        }
Example #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"));
            }
        }