コード例 #1
0
        public ActionResult Index()
        {
            var bStatictics = new B_Statistics();
            var requestData = bStatictics.GetRequestStatisticsPastMonth();

            ViewBag.ReqData     = "";
            ViewBag.ReqCategory = "";
            foreach (var li in requestData)
            {
                ViewBag.ReqData     += ViewBag.ReqData == "" ? li.Item2 + "" : "," + li.Item2;
                ViewBag.ReqCategory += ViewBag.ReqCategory == "" ? "'" + li.Item1 + "'" : ",'" + li.Item1 + "'";
            }
            ViewBag.UserCount = bStatictics.GetUsersCount();

            var markers = "";

            foreach (var li in new B_ServicesRequests().GetFullLast30Request())
            {
                markers += "{ 'popupContent': '" + getMapPupWindow(li) + "', 'center': { 'lat': " + li.GeographicalCoordinates.Split(',')[0].Trim() + " ,'lng': " + li.GeographicalCoordinates.Split(',')[1].Trim() + " }, 'iconOpts': { 'iconUrl': '/Areas/Admin/Images/MapMarker" + (li.Status == Enums.E_PublicCategory.REQUEST_STATUS.NEW_REQUEST ? "New" : "Other") + ".png', 'iconRetinaUrl': '/Areas/Admin/Images/MapMarker" + (li.Status == Enums.E_PublicCategory.REQUEST_STATUS.NEW_REQUEST ? "New" : "Other") + ".png', 'iconSize': [30, 38] } },";
            }

            ViewBag.LastestRequest = markers;

            var chartTypeRes = new B_ServicesRequests().GetForChartType();
            var reqStatus    = new B_PublicCategory().GetPublicCategory(E_PublicCategory.PUBLIC_CATEGORY_PARENT.REQUEST_STATUS);

            foreach (var li in chartTypeRes)
            {
                ViewBag.ForChartType += "['" + reqStatus.Where(c => c.Id == (int)li.Item2).FirstOrDefault().Title + "', " + li.Item1 + "],";
            }


            var chartTypePay   = new B_UserPayment().GetForChartType();
            var chartStatusPay = new B_UserPayment().GetForChartStatus();
            var payType        = new B_PublicCategory().GetPublicCategory(E_PublicCategory.PUBLIC_CATEGORY_PARENT.PAYMENT_TYPE);
            var payStatus      = new B_PublicCategory().GetPublicCategory(E_PublicCategory.PUBLIC_CATEGORY_PARENT.PAYMENT_STATUS);

            foreach (var li in chartTypePay)
            {
                ViewBag.ForChartPayType += "['" + payType.Where(c => c.Id == (int)li.Item2).FirstOrDefault().Title + "', " + li.Item1 + "],";
            }
            foreach (var li in chartStatusPay)
            {
                ViewBag.ForChartPayStatus += "['" + payStatus.Where(c => c.Id == (int)li.Item2).FirstOrDefault().Title + "', " + li.Item1 + "],";
            }

            ViewBag.BoothCount = bStatictics.GetBoothCount();

            return(View());
        }
コード例 #2
0
        public ActionResult GetPeymentDetails(int PayId)
        {
            object result = "";

            try
            {
                var peymentReuest = new B_UserPayment().GetPaymentById(PayId);
                var payTypes      = new B_PublicCategory().GetPublicCategory(E_PublicCategory.PUBLIC_CATEGORY_PARENT.PAYMENT_TYPE);
                var payStatus     = new B_PublicCategory().GetPublicCategory(E_PublicCategory.PUBLIC_CATEGORY_PARENT.PAYMENT_STATUS);

                var account = new B_Accounts().GetAccounts(peymentReuest.AccountId);

                var user = new B_Users().GetUsers(peymentReuest.UserId);
                result = new
                {
                    Payment = new
                    {
                        Point      = peymentReuest.Point,
                        CreateDate = peymentReuest.CreateDate.ConvertToPesianDateName(true),
                        EditDate   = peymentReuest.ModifyDate.ConvertToPesianDateName(true),
                        Status     = payStatus.Where(c => c.Id == (int)peymentReuest.Status).FirstOrDefault().Title,
                        StatusCode = (int)peymentReuest.Status,
                        Message    = peymentReuest.Message,
                        Type       = payTypes.Where(c => c.Id == (int)peymentReuest.Type).FirstOrDefault().Title
                    },
                    AccountInfo = new
                    {
                        Shaba           = account == null ? "---" : account.ShabaNumber,
                        PayAccountOwner = account == null ? "---" : account.AccountHolderName,
                        BankName        = account == null ? "---" : account.BankName
                    },
                    User = new { Name = user.FirstName + " " + user.LastName, RegisterDate = user.RegisterDate.ConvertToPesianDateName(true), Tell = user.MobileNumber, Image = user.ImageName }
                };
            }
            catch (Exception ex)
            {
                M_SystemLog exx = new M_SystemLog(E_SystemType.SHAHRDARI_WEB_APPLICATION, E_LogType.ERROR, ex);
                result = "Error";
                if (ex.Source == E_LogType.SYSTEM_ERROR.ToString())
                {
                    exx.LogType = E_LogType.SYSTEM_ERROR;
                    result      = exx;
                }
                L_Log.SubmitLog(exx);
            }
            return(Json(result));
        }
コード例 #3
0
        public ActionResult GetPayments(int PageNumber, E_PublicCategory.PAYMENT_TYPE?Type, E_PublicCategory.PAYMENT_STATUS?Status)
        {
            object result = "";

            try
            {
                var payRequest = new B_UserPayment().GetPayment(PageNumber, Type, Status);
                var res        = new List <object>();
                var payTypes   = new B_PublicCategory().GetPublicCategory(E_PublicCategory.PUBLIC_CATEGORY_PARENT.PAYMENT_TYPE);
                var payStatus  = new B_PublicCategory().GetPublicCategory(E_PublicCategory.PUBLIC_CATEGORY_PARENT.PAYMENT_STATUS);

                foreach (var li in payRequest)
                {
                    res.Add(new
                    {
                        Title      = payTypes.Where(c => c.Id == (int)li.Type).FirstOrDefault().Title,
                        CreateDate = li.CreateDate.ConvertToPesianDateName(true),
                        Status     = payStatus.Where(c => c.Id == (int)li.Status).FirstOrDefault().Title,
                        StatusCode = (int)li.Status,
                        Score      = li.Point,
                        Id         = li.Id
                    });
                }

                result = res;
            }
            catch (Exception ex)
            {
                M_SystemLog exx = new M_SystemLog(E_SystemType.SHAHRDARI_WEB_APPLICATION, E_LogType.ERROR, ex);
                result = "Error";
                if (ex.Source == E_LogType.SYSTEM_ERROR.ToString())
                {
                    exx.LogType = E_LogType.SYSTEM_ERROR;
                    result      = exx;
                }
                L_Log.SubmitLog(exx);
            }
            return(Json(result));
        }
コード例 #4
0
        public ActionResult ChangeState(E_PublicCategory.PAYMENT_STATUS Status, int PayId)
        {
            object result = "";

            try
            {
                var peyment = new B_UserPayment().ChangeState(Status, PayId);
                var user    = new B_Users().GetUsers(peyment.UserId);
                if (Status == E_PublicCategory.PAYMENT_STATUS.FAILED)
                {
                    new B_ServicesRequestItems().Add(new Models.M_ServicesRequestItems
                    {
                        CreateDate   = DateTime.Now,
                        ImageName    = "Default.png",
                        RequestId    = 0,
                        ScorePerUnit = 1,
                        Title        = "بازگشت امتیاز به دلیل لغو درخواست برداشت امتیاز به شماره " + peyment.Id,
                        Unit         = "امتیاز",
                        UserType     = peyment.UserType,
                        Value        = peyment.Point,
                        UserId       = user.Id
                    });
                }
                result = true;
            }
            catch (Exception ex)
            {
                M_SystemLog exx = new M_SystemLog(E_SystemType.SHAHRDARI_WEB_APPLICATION, E_LogType.ERROR, ex);
                result = "Error";
                if (ex.Source == E_LogType.SYSTEM_ERROR.ToString())
                {
                    exx.LogType = E_LogType.SYSTEM_ERROR;
                    result      = exx;
                }
                L_Log.SubmitLog(exx);
            }
            return(Json(result));
        }
コード例 #5
0
        public ActionResult GetUserPointDetails(int UserId)
        {
            object result = "";

            try
            {
                var    peymentReuest       = new B_UserPayment().GetPayment(UserId);
                var    peymentRequestItems = new B_ServicesRequestItems().GetItem(UserId, E_PublicCategory.SYSTEM_USER_TYPE.NORMAL_USER);
                var    res = new List <DetaildPointModel>();
                double pointPay = 0, pointRecive = 0;
                var    payStatus = new B_PublicCategory().GetPublicCategory(E_PublicCategory.PUBLIC_CATEGORY_PARENT.PAYMENT_STATUS);
                var    payType   = new B_PublicCategory().GetPublicCategory(E_PublicCategory.PUBLIC_CATEGORY_PARENT.PAYMENT_TYPE);

                foreach (var li in peymentReuest)
                {
                    res.Add(new DetaildPointModel
                    {
                        Title    = payType.Where(c => c.Id == (int)li.Type).FirstOrDefault().Title,
                        Date     = li.CreateDate.ConvertToPesianDateName(true),
                        Time     = li.CreateDate.Hour + ":" + li.CreateDate.Minute + ":" + li.CreateDate.Second,
                        Score    = (li.Point * -1).ToString(),
                        Status   = payStatus.Where(c => c.Id == (int)li.Status).FirstOrDefault().Title,
                        RealDate = li.CreateDate
                    });
                    if (li.Status != E_PublicCategory.PAYMENT_STATUS.FAILED)
                    {
                        pointPay += li.Point * -1;
                    }
                }

                foreach (var li in peymentRequestItems)
                {
                    res.Add(new DetaildPointModel
                    {
                        Title    = li.Title,
                        Date     = li.CreateDate.ConvertToPesianDateName(true),
                        Time     = li.CreateDate.Hour + ":" + li.CreateDate.Minute + ":" + li.CreateDate.Second,
                        Score    = ((li.Value.HasValue ? li.Value.Value : 0) * li.ScorePerUnit).ToString(),
                        Status   = "ثبت شده",
                        RealDate = li.CreateDate
                    });
                    pointRecive += (li.Value.HasValue ? li.Value.Value : 0) * li.ScorePerUnit;
                }

                var user = new B_Users().GetUsers(UserId);
                result = new
                {
                    PointSummery = new { PointPay = pointPay, PointRecive = pointRecive, PointTotal = pointRecive + pointPay },
                    PointDetails = res.OrderByDescending(c => c.RealDate).ToList(),
                    User         = new { Name = user.FirstName + " " + user.LastName, RegisterDate = user.RegisterDate.ConvertToPesianDateName(true), Tell = user.MobileNumber }
                };
            }
            catch (Exception ex)
            {
                M_SystemLog exx = new M_SystemLog(E_SystemType.SHAHRDARI_WEB_APPLICATION, E_LogType.ERROR, ex);
                result = "Error";
                if (ex.Source == E_LogType.SYSTEM_ERROR.ToString())
                {
                    exx.LogType = E_LogType.SYSTEM_ERROR;
                    result      = exx;
                }
                L_Log.SubmitLog(exx);
            }
            return(Json(result));
        }