コード例 #1
0
ファイル: OrderService.cs プロジェクト: MrDragann/CShop
        /// <summary>
        /// Получить список заказов
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public PaginationResponse <OrderAdmin.OrderHeaderModel> GetFilteredOrders(PaginationRequest <BaseFilter> request)
        {
            using (var db = new DataContext())
            {
                var query = db.OrderHeaders.AsNoTracking().Include(x => x.User.UserAddress)
                            .Where(x => !x.IsDelete.HasValue && x.Status != (int)EnumStatusOrder.Cart)
                            .OrderByDescending(x => x.DateCreate) as IQueryable <OrderHeader>;

                //if (!string.IsNullOrEmpty(request.Filter.Term))
                //    query = query.Where(x => x.Code.ToLower().Contains(request.Filter.Term.ToLower()));

                var model = new PaginationResponse <OrderAdmin.OrderHeaderModel> {
                    Count = query.Count()
                };

                query = request.Load(query);

                model.Items = query.ToList().Select(x => new OrderAdmin.OrderHeaderModel
                {
                    Id         = x.Id,
                    DateCreate = x.DateCreate,
                    UserName   = $"{x.User?.FirstName} {x.User?.LastName}",
                    StatusName = EnumService.GetEnumDescription((EnumStatusOrder)x.Status),
                    Amount     = x.Amount
                }).ToList();
                return(model);
            }
        }
コード例 #2
0
 private CareTrackingVM populateCTDDropDownList(CareTrackingVM viewModel)
 {
     viewModel.MechanicList        = EnumService.GetPersonTypeList((int)PersonType.Mecanic);
     viewModel.ReceivingPersonList = EnumService.GetPersonTypeList((int)PersonType.ReceivingPerson);
     viewModel.ResultTypeList      = EnumService.GetEnumTypesByParent((int)TypeEnum.ResultType);
     return(viewModel);
 }
コード例 #3
0
ファイル: PersonController.cs プロジェクト: huseynhe/ITS
        private PersonVM populateDropDownList(PersonVM viewModel)
        {
            viewModel.GenderTypeList = EnumService.GetEnumTypesByParent((int)TypeEnum.GenderType);
            viewModel.PersonTypeList = EnumService.GetEnumTypesByParent((int)TypeEnum.PersonType);

            return(viewModel);
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: AnCalm/PayClient
        void AddDataGridRows(Order order)
        {
            int index = this.dgOrderCharge.Rows.Add();

            dgOrderCharge.Rows[index].Cells["OrderInsideID"].Value     = order.OrderInsideID;
            dgOrderCharge.Rows[index].Cells["OrderExternalID"].Value   = order.OrderExternalID;
            dgOrderCharge.Rows[index].Cells["ProductName"].Value       = order.ProductName;
            dgOrderCharge.Rows[index].Cells["ProductParValue"].Value   = order.ProductParValue;
            dgOrderCharge.Rows[index].Cells["TargetAccount"].Value     = order.TargetAccount;
            dgOrderCharge.Rows[index].Cells["BuyAmount"].Value         = order.BuyAmount;
            dgOrderCharge.Rows[index].Cells["GameName"].Value          = order.GameName;
            dgOrderCharge.Rows[index].Cells["AreaName"].Value          = order.AreaName;
            dgOrderCharge.Rows[index].Cells["ServerName"].Value        = order.ServerName;
            dgOrderCharge.Rows[index].Cells["StartDatetime"].Value     = order.StartDatetime;
            dgOrderCharge.Rows[index].Cells["RechargeStatus"].Value    = EnumService.GetDescription((int)order.RechargeStatus);
            dgOrderCharge.Rows[index].Cells["SuccessfulAmount"].Value  = order.SuccessfulAmount;
            dgOrderCharge.Rows[index].Cells["RechargeMsg"].Value       = order.RechargeMsg;
            dgOrderCharge.Rows[index].Cells["ChargeAccountInfo"].Value = order.ChargeAccountInfo;
            dgOrderCharge.Rows[index].Cells["EndDatetime"].Value       = order.EndDatetime;

            while (dgOrderCharge.Rows.Count > 20)
            {
                dgOrderCharge.Rows.RemoveAt(0);
            }
        }
コード例 #5
0
        public Map()
        {
            base.CreateMap <Trainer, TrainerDto>();

            base.CreateMap <Student, StudentDto>().ForMember(
                dest => dest.StudentWeights,
                opt => opt.MapFrom(src => src.StudentWeights));

            base.CreateMap <StudentWeight, StudentWeightDto>()
            .ForMember(
                dest => dest.StudentId,
                opt => opt.MapFrom(src => src.StudentId))
            .ForMember(
                dest => dest.StudentName,
                opt => opt.MapFrom(src => string.Format("{0} {1}", src.Student.FirstName, src.Student.LastName)));

            EnumService enumService = new EnumService();

            base.CreateMap <Lesson, LessonDto>()
            .ForMember(
                dest => dest.StudentName,
                opt => opt.MapFrom(src => string.Format("{0} {1}", src.Student.FirstName, src.Student.LastName)))
            .ForMember(
                dest => dest.TrainerName,
                opt => opt.MapFrom(src => string.Format("{0} {1}", src.Trainer.FirstName, src.Trainer.LastName)))
            .ForMember(
                dest => dest.Money,
                opt => opt.MapFrom(src => src.Student.PrepaidMoney))
            .ForMember(
                dest => dest.HourDescription,
                opt => opt.MapFrom(src => enumService.GetDescription(src.Hour)))
            .ForMember(
                dest => dest.MinutesDescription,
                opt => opt.MapFrom(src => enumService.GetDescription(src.Minutes)));
        }
コード例 #6
0
        private UserVM poulateDropDownList(UserVM viewModel)
        {
            viewModel.LockTypes    = EnumService.GetLockEnumTypes();
            viewModel.UserTypeList = EnumService.GetEnumValueListByEcID((int)CategoryEnum.UserType);

            return(viewModel);
        }
コード例 #7
0
 private void InitInfo()
 {
     foreach (KnowledgePointAttrEnum item in Enum.GetValues(typeof(KnowledgePointAttrEnum)))
     {
         ddlAttr.Items.Add(new ListItem(EnumService.GetDescription(item), item.ToString()));
     }
 }
コード例 #8
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            UserProfileSessionData UserProfile = (UserProfileSessionData)HttpContext.Current.Session["UserProfile"];
            string         UserName            = UserProfile.UserName;
            int            UserId     = UserProfile.UserId;
            UrlSessionData CurrentUrl = (UrlSessionData)HttpContext.Current.Session["CurrentUrl"];

            string ActionName     = HttpContext.Current.Request.RequestContext.RouteData.Values["action"].ToString();
            string ControllerName = HttpContext.Current.Request.RequestContext.RouteData.Values["controller"].ToString() + "Controller";

            AccessRightsRepository uar   = new AccessRightsRepository();
            string ControllerDescription = EnumService.GetControllerDescription(ControllerName);
            string ActionDescription     = EnumService.GetActionDescription(ControllerName, ActionName);
            bool   uacresult             = uar.UserAccessCheck(UserId, ControllerName, ActionName);

            if (UserName.ToLower() != "admin" && !uacresult && ControllerName != ControllerDescription && ActionDescription != null)
            {
                string RedirectUrl = "/Home/AccessRightsError?CName=" + CurrentUrl.Controller + "&AName=" + CurrentUrl.Action;
                //filterContext.HttpContext.Response.Redirect(RedirectUrl,false);

                filterContext.Result = new RedirectToRouteResult("Error_Deafult", new RouteValueDictionary(new { controller = "Home", action = "AccessRightsError", CName = CurrentUrl.Controller, AName = CurrentUrl.Action }));
            }
            else
            {
                CurrentUrl.Controller = ControllerName.Substring(0, ControllerName.IndexOf("Controller"));
                CurrentUrl.Action     = ActionName;
                HttpContext.Current.Session["CurrentUrl"] = CurrentUrl;
                base.OnActionExecuting(filterContext);
            }
        }
コード例 #9
0
        private UserVM poulateDropDownList(UserVM viewModel)
        {
            viewModel.LockTypes     = EnumService.GetLockEnumTypes();
            viewModel.EmpmloyeeList = EnumService.GetEmployeeList();

            return(viewModel);
        }
コード例 #10
0
ファイル: QueryXunTong.cs プロジェクト: AnCalm/PayClient
        public Order Query(Order order)
        {
            string MerchantID = PayAndQueryXunTong.merchantID;
            string key        = PayAndQueryXunTong.key;
            string QueryUrl   = PayAndQueryXunTong.QueryUrl;


            CookieContainer coockie = new CookieContainer();

            string username  = MerchantID;          //	接入代理用户名
            string type      = "qb";                //	查询类型(固定:qb)
            string sporderid = order.OrderInsideID; //	SP订单号,商户平台的订单号,最长32位(yyyyMMddHHmmss+8)
            string buyhaoma  = order.TargetAccount; //	要进行查询的号码
            string sign      = "";                  //	MD5组合数字签名方式:MD5(username={}&type={}&sporderid={}&buyhaoma={}&key=APIkey加密串均为小写,MD5输出为32位小写


            string strmd5 = "username="******"&type=" + type + "&sporderid=" + sporderid + "&buyhaoma=" + buyhaoma + "&key=" + key;;

            sign = Md5Helper.MD5Encrypt(strmd5);

            StringBuilder str = new StringBuilder();

            str.AppendFormat("username={0}", username);
            str.AppendFormat("&type={0}", type);
            str.AppendFormat("&sporderid={0}", sporderid);
            str.AppendFormat("&buyhaoma={0}", buyhaoma);
            str.AppendFormat("&sign={0}", sign);


            WriteLog.Write("方法:Query,订单号:" + order.OrderInsideID + " XunTong 订单查询参数:" + str.ToString(), LogPathFile.Recharge.ToString());

            string result = PostAndGet.HttpPostString(QueryUrl, str.ToString(), ref coockie);

            WriteLog.Write("方法:Query,订单号:" + order.OrderInsideID + " XunTong 订单查询:" + result, LogPathFile.Recharge.ToString());

            // 001 充值成功 002 充值失败 003 充值处理中 004,已冲正 005,充正中 006其他情况

            if (result.Equals("001") || result.Equals("004"))
            {
                order.RechargeStatus = (int)OrderRechargeStatus.successful;
                order.RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.successful);
            }
            else if (result.Equals("002"))
            {
                order.RechargeStatus = (int)OrderRechargeStatus.failure;
                order.RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.failure);
            }
            else if (result.Equals("003") || result.Equals("005") || result.Equals("006"))
            {
                //充值中
            }
            else
            {
                order.RechargeStatus = (int)OrderRechargeStatus.suspicious;
                order.RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.suspicious);
            }

            return(order);
        }
コード例 #11
0
ファイル: MyResponse.cs プロジェクト: lyc524/AmbAPI
        /// <summary>
        /// 重写ToString()返回JSON
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            Msg = EnumService.GetDescription(Code);
            //string s = JsonConvert.SerializeObject(this);
            string s = "{\"code\":\"" + (int)Code + "\",\"msg\":\"" + Msg + "\",\"count\":\"" + Count + "\",\"data\":" + Data + "}";

            return(s);
        }
コード例 #12
0
 public AccountController(AuthenticationService _authenticationService,
                          UserService _userService,
                          EnumService _enumService)
 {
     authenticationService = _authenticationService;
     userService           = _userService;
     enumService           = _enumService;
 }
コード例 #13
0
 /// <summary>
 /// 备课阶段
 /// </summary>
 private void InitInfo()
 {
     ddlStage.Items.Add(new ListItem("--请选择--", "-1"));//--请选择--;
     foreach (PrpeLessonStageEnum item in Enum.GetValues(typeof(PrpeLessonStageEnum)))
     {
         ddlStage.Items.Add(new ListItem(EnumService.GetDescription(item), item.ToString()));
     }
 }
コード例 #14
0
ファイル: QueryMBJ.cs プロジェクト: AnCalm/PayClient
        public Order Query(Order order)
        {
            string MerchantID = PayAndQueryMBJ.merchantID;
            string key        = PayAndQueryMBJ.key;
            string QueryUrl   = PayAndQueryMBJ.queryUrl;


            CookieContainer coockie = new CookieContainer();

            string        strmd5 = MerchantID + order.OrderInsideID + key;
            string        sign   = Md5Helper.MD5Encrypt(strmd5);
            StringBuilder str    = new StringBuilder();

            str.AppendFormat("MerchantID={0}", MerchantID);                //商家编号
            str.AppendFormat("&MerchantOrderID={0}", order.OrderInsideID); //商家订单编号
            str.AppendFormat("&Sign={0}", sign);                           //数字签名


            WriteLog.Write("方法:Query,订单号:" + order.OrderInsideID + " MBJ 订单查询参数:" + str.ToString(), LogPathFile.Recharge.ToString());

            string result = PostAndGet.HttpPostString(QueryUrl, str.ToString(), ref coockie);

            WriteLog.Write("方法:Query,订单号:" + order.OrderInsideID + " MBJ 订单查询:" + result, LogPathFile.Recharge.ToString());

            string state        = Regex.Match(result, @"<state>(.*?)</state>").Groups[1].Value;
            string mbjOrderId   = Regex.Match(result, @"<order-id>(.*?)</order-id>").Groups[1].Value;
            string mbjStateInfo = Regex.Match(result, @"<state-info>(.*?)</state-info>").Groups[1].Value;


            if (state.Equals("101"))
            {
                order.RechargeStatus = (int)OrderRechargeStatus.successful;
                order.RechargeMsg    = mbjStateInfo + "-" + mbjOrderId;
            }
            else if (state.Equals("201") || state.Equals("202") || state.Equals("203") || state.Equals("301") || state.Equals("302") || state.Equals("304") ||
                     state.Equals("305") || state.Equals("306") || state.Equals("307") || state.Equals("401") || state.Equals("405") || state.Equals("501"))
            {
                order.RechargeStatus = (int)OrderRechargeStatus.failure;
                order.RechargeMsg    = mbjStateInfo + "-" + mbjOrderId;
            }
            else if (state.Equals("601"))
            {
                int status = getOrderStatus(mbjStateInfo, "601");
                order.RechargeStatus = status;
                order.RechargeMsg    = mbjStateInfo + "-" + mbjOrderId;
            }
            else if (state.Equals("102"))
            {//充值中
            }
            else
            {
                order.RechargeStatus = (int)OrderRechargeStatus.suspicious;
                order.RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.suspicious) + "-" + mbjOrderId;
            }


            return(order);
        }
コード例 #15
0
 public EnumServiceTests()
 {
     _mapper = new Mapper(new MapperConfiguration(conf =>
     {
         conf.AddProfile <YeastEntityToDtoProfile>();
         conf.AddProfile <EnumToDtoProfile>();
     }));
     _testClass = new EnumService(_mapper);
 }
コード例 #16
0
ファイル: MachineController.cs プロジェクト: huseynhe/ITS
        private MachineVM populateDropDownList(MachineVM viewModel)
        {
            //viewModel.GenderTypeList = EnumService.GetEnumTypesByParent((int)TypeEnum.GenderType);
            viewModel.MachineGroupList      = EnumService.GetMachineGroupList();
            viewModel.BusinessCenterList    = EnumService.GetBusinessCenterList();
            viewModel.ResponsiblePersonList = EnumService.GetPersonTypeList((int)PersonType.ResponsiblePerson);

            return(viewModel);
        }
コード例 #17
0
 public static string GetDataList(string TabName, string TabType, int PageIndex, int PageSize)
 {
     try
     {
         TabName = TabName.Filter();
         TabType = TabType.Filter();
         string strWhere = " 1=1 ";
         if (!string.IsNullOrEmpty(TabName))
         {
             strWhere += string.Format(" and (TabName like '%{0}%' or Tabindex like '%{0}%') ", TabName);
         }
         if (!string.IsNullOrEmpty(TabType))
         {
             strWhere += string.Format(" and TabType='{0}' ", TabType);
         }
         int           intRecordCount = 0;
         List <object> listReturn     = new List <object>();
         BLL_ClientTab bll            = new BLL_ClientTab();
         DataTable     dt             = bll.GetListByPage(strWhere, "TabType,CreateTime", ((PageIndex - 1) * PageSize + 1), PageIndex * PageSize).Tables[0];
         intRecordCount = bll.GetRecordCount(strWhere);
         foreach (DataRow item in dt.Rows)
         {
             listReturn.Add(new
             {
                 Tabindex   = item["Tabindex"].ToString(),
                 TabName    = item["TabName"].ToString(),
                 TabType    = EnumService.GetDescription <Rc.Model.Resources.ClientTabTypeEnum>(item["TabType"].ToString()),
                 CreateTime = pfunction.ConvertToLongDateTime(item["CreateTime"].ToString())
             });
         }
         if (dt.Rows.Count > 0)
         {
             return(JsonConvert.SerializeObject(new
             {
                 err = "null",
                 PageIndex = PageIndex,
                 PageSize = PageSize,
                 TotalCount = intRecordCount,
                 list = listReturn
             }));
         }
         else
         {
             return(JsonConvert.SerializeObject(new
             {
                 err = "暂无数据"
             }));
         }
     }
     catch (Exception ex)
     {
         return(JsonConvert.SerializeObject(new
         {
             err = "error"
         }));
     }
 }
コード例 #18
0
ファイル: RPCServiceProxy.cs プロジェクト: zjmsky/SAEA
 public RPCServiceProxy(string uri, int links = 4, int retry = 5, int timeOut = 10 * 1000)
 {
     ExceptionCollector.OnErr += ExceptionCollector_OnErr;
     _serviceConsumer          = new ServiceConsumer(new Uri(uri), links, retry, timeOut);
     _En = new EnumService(_serviceConsumer);
     _Gr = new GroupService(_serviceConsumer);
     _He = new HelloService(_serviceConsumer);
     _Di = new DicService(_serviceConsumer);
     _Ge = new GenericService(_serviceConsumer);
 }
コード例 #19
0
        public async Task <OptionsViewModel> GetOptions()
        {
            var typeOptions = await _somethingTypeRepository.GetAll();

            return(new OptionsViewModel
            {
                TypeOptions = _mapper.Map <List <IntOption> >(typeOptions),
                StatusOptions = EnumService.GetIntOptions <SomethingStatus>()
            });
        }
コード例 #20
0
        public Order Query(Order order)
        {
            PayAndQueryFulu pay1 = new PayAndQueryFulu();

            string result = pay1.QueryOrder(order);

            // 直充商品:
            //{
            //    "code": 0,
            //    "message": "接口调用成功",
            //    "result": "{\"area\":\"电信一区\",\"buy_num\":1,\"cards\":null,\"charge_account\":\"888888\",\"create_time\":\"2019-07-01 17:53:32\",\"customer_order_no\":\"201906281030191013526\",\"finish_time\":\"2019-07-01 17:53:41\",\"operator_serial_number\":\"--\",\"order_id\":\"19070134869845421753\",\"order_price\":40.0,\"order_state\":\"success\",\"order_type\":4,\"product_id\":10000373,\"product_name\":\"qb5测试代充账号功能\",\"server\":\"逐鹿中原\",\"type\":\"Q币\"}",
            //    "sign": "06f351b34d9b02bc13bc62e66bdab2c8"
            //}
            //卡密商品:
            //{
            //    "code": 0,
            //    "message": "接口调用成功",
            //    "result": "{\"area\":null,\"buy_num\":2,\"cards\":[{\"CardNumber\":\"12nCp6X/nALmrvr1erxK+D4L8n/kqz/RItKWUfvZrCU=\",\"CardPwd\":\"9HeOgdv+NpLihh2+5Gm0Mj4L8n/kqz/RItKWUfvZrCU=\",\"CardDeadline\":\"2019-06-30 11:15:32\"},{\"CardNumber\":\"12nCp6X/nALmrvr1erxK+BzfvN8D1qbXOYunJrydEWA\",\"CardPwd\":\"9HeOgdv+NpLihh2+5Gm0MhzfvN8D1qbXOYunJrydEWA=\",\"CardDeadline\":\"2019-06-30 11:15:32\"}],\"charge_account\":null,\"create_time\":\"2019-07-01 17:55:38\",\"customer_order_no\":\"201906281230191013521\",\"finish_time\":\"2019-07-01 17:55:41\",\"operator_serial_number\":\"\",\"order_id\":\"19070116656844081755\",\"order_price\":8.9999,\"order_state\":\"success\",\"order_type\":3,\"product_id\":10000481,\"product_name\":\"入库出库专用卡密库存不要随便使用-jfs\",\"server\":null,\"type\":null}",
            //    "sign": "d440344a46479d3fa61883bcc2f1d983"
            //}
            JavaScriptObject jsonObj = (JavaScriptObject)JavaScriptConvert.DeserializeObject(result);

            string code    = jsonObj["code"].ToString();
            string message = jsonObj["message"].ToString();

            string resultJson = jsonObj["result"].ToString();

            JavaScriptObject jsonObj2    = (JavaScriptObject)JavaScriptConvert.DeserializeObject(resultJson);
            string           order_id    = jsonObj2["order_id"].ToString();
            string           order_state = jsonObj2["order_state"].ToString();

            //订单状态: (success:成功,processing:处理中,failed:失败,untreated:未处理)

            switch (order_state)
            {
            case "success":
                order.RechargeStatus = (int)OrderRechargeStatus.successful;
                order.RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.successful) + "-" + order_state;
                return(order);

            case "failed":

                order.RechargeStatus = (int)OrderRechargeStatus.failure;

                order.RechargeMsg = EnumService.GetDescription(OrderRechargeStatus.failure) + "-" + order_state;
                return(order);

            case "processing":
            case "untreated":
            default:
                break;
            }

            return(order);
        }
コード例 #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string key = "duZBIBf3XTNXcBw9VY5K6zMVxTAKBjNn";

            string client_order_no  = Request["client_order_no"];  //	商户订单号	是	32
            string up_order_no      = Request["up_order_no"];      //	充值平台订单号	是	32
            string product_type     = Request["product_type"];     //	产品类型	        是	10
            string phone_no         = Request["phone_no"];         //	充值号码	是	20
            string deduction_amount = Request["deduction_amount"]; //	折扣金额	是	20
            string recharge_status  = Request["recharge_status"];  //	2:充值成功 6:充值失败	是	10
            string elecardID        = Request["elecardID"];        //	运营商充值凭证	否	128
            string desc             = Request["desc"];             //	失败描述(该字段不参与签名)使用UTF-8 URLDECODE编码	否	256
            string channel_type     = Request["channel_type"];     //	渠道编码(该字段不参与签名)参考附录8	否	10
            string sign             = Request["sign"];             //	数据签名	是	32



            WriteLog.Write("方法:ZhiXin回调,client_order_no:" + client_order_no + " up_order_no:" + up_order_no +
                           "recharge_status:" + recharge_status, LogPathFile.Other.ToString());

            string md5str = "client_order_no" + client_order_no + "deduction_amount" + deduction_amount + "elecardID" + elecardID + "phone_no" + phone_no + "product_type" + product_type + "recharge_status" + recharge_status + "up_order_no" + up_order_no + key;

            string checkSign = Md5Helper.MD5Encrypt(md5str);

            if (sign == checkSign)
            {
                int    RechargeStatus = (int)OrderRechargeStatus.processing;
                string RechargeMsg    = string.Empty;

                if (recharge_status.Equals("2"))
                {
                    RechargeStatus = (int)OrderRechargeStatus.successful;
                    RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.successful);
                }
                else if (recharge_status.Equals("6"))
                {
                    RechargeStatus = (int)OrderRechargeStatus.failure;
                    RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.failure);
                }
                else
                {//充值中
                }

                new SQLOrder().UpdateNotifyOrderBySql(client_order_no, RechargeStatus, RechargeMsg);
            }
            else
            {
                WriteLog.Write("方法:ZhiXin回调 本地系统订单号:" + client_order_no +
                               "签名验证错误,ZhiXin数字签名" + sign + "本地签名:" + checkSign, LogPathFile.Other.ToString());
            }


            Response.Write("SUCCESS");
        }
コード例 #22
0
        public ActionResult Index()
        {
            var enumService = new EnumService();

            var model = new HanoiViewModel();

            model.HanoiAlgorithms  = enumService.GetHanoiAlgorithmTypes();
            model.SelectedPosition = model.HanoiAlgorithms.First().Text;

            return(View(model));
        }
コード例 #23
0
        private CareTrackingVM populateDropDownList(CareTrackingVM viewModel)
        {
            viewModel.BusinessCenterList = EnumService.GetBusinessCenterList();
            viewModel.MachineGroupList   = EnumService.GetMachineGroupList();
            viewModel.MachineList        = EnumService.GetMachineList();
            viewModel.CareTypeList       = EnumService.GetEnumTypesByParent((int)TypeEnum.CareType);
            viewModel.PlanedCareTypeList = EnumService.GetEnumTypesByParent((int)TypeEnum.PlanedCareType);
            viewModel.CareTeamTypeList   = EnumService.GetEnumTypesByParent((int)TypeEnum.CareTeamType);

            return(viewModel);
        }
コード例 #24
0
 private void InitInfo()
 {
     foreach (TestQuestions_Type item in Enum.GetValues(typeof(TestQuestions_Type)))
     {
         ddlTestQuestions_Type.Items.Add(new ListItem(EnumService.GetDescription(item), item.ToString()));
     }
     //foreach (ComplexityText item in Enum.GetValues(typeof(ComplexityText)))
     //{
     //    ddlComplexityText.Items.Add(new ListItem(EnumService.GetDescription(item), item.ToString()));
     //}
 }
コード例 #25
0
        public UserAddViewModel()
        {
            _enumService         = new EnumService();
            _organizationService = new OrganizationService();
            SaveCommand          = new RelayCommand(Save);
            ExitCommand          = new RelayCommand(Exit);

            EnumList         = new List <EnumEntity>();
            OrganizationList = new List <OrganizationEntity>();
            GetEnumList();
            GetOrganizationList();
        }
コード例 #26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     strPath   = Request.Url.ToString();
     Module_Id = "90500500";
     if (!IsPostBack)
     {
         ddlTabType.Items.Add(new ListItem("Tab类型", ""));
         foreach (var item in Enum.GetValues(typeof(Rc.Model.Resources.ClientTabTypeEnum)))
         {
             ddlTabType.Items.Add(new ListItem(EnumService.GetDescription <Rc.Model.Resources.ClientTabTypeEnum>(item.ToString()), item.ToString()));
         }
     }
 }
コード例 #27
0
 protected void Page_Load(object sender, EventArgs e)
 {
     AudioVideoBookId = Request.QueryString["AudioVideoBookId"];
     BookName         = Server.UrlDecode(Request.QueryString["BookName"]);
     if (!IsPostBack)
     {
         ddlAudioVideoTypeEnum.Items.Add(new ListItem("--视频类型--", "-1"));
         foreach (var item in Enum.GetValues(typeof(Rc.Model.Resources.AudioVideoTypeEnum)))
         {
             ddlAudioVideoTypeEnum.Items.Add(new ListItem(EnumService.GetDescription <Rc.Model.Resources.AudioVideoTypeEnum>(item.ToString()), item.ToString()));
         }
     }
 }
コード例 #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string key = "8af8ef3102bd5361ce69a7c12989a4dd";


            string ste   = Request["ste"];   //	订单状态	必选	String	是	订单状态0为成功,1为失败
            string cid   = Request["cid"];   //	商家ID	必选	String	是	商家在我们系统注册的ID
            string oid   = Request["oid"];   //	商家订单号	必选	String	是	商家系统生成的ID
            string pn    = Request["pn"];    //	充值帐号	必选	String	是	充值帐号
            string sign  = Request["sign"];  //	MD5签名	必选	String	是	原串拼接规则:ste+cid+oid+pn+key 例:0+test+101447975+123456+test
            string info1 = Request["info1"]; //	商家自定义	必选	String	否	可选参数,原样返回(下单商品为卡密商品类型时,这个字段将存放卡密,提取时需用标准3DES解密算法解Decrypt(info1,key)
            string info2 = Request["info2"]; //	商家自定义	必选	String	否	可选参数,原样返回


            WriteLog.Write("方法:RuiLian回调,OrderID:" + oid + " cid:" + cid +
                           "State:" + ste, LogPathFile.Other.ToString());

            string md5str = ste + cid + oid + pn + key;

            string checkSign = Md5Helper.MD5Encrypt(md5str);

            if (sign == checkSign)
            {
                int    RechargeStatus = (int)OrderRechargeStatus.processing;
                string RechargeMsg    = string.Empty;

                if (ste.Equals("1"))
                {
                    RechargeStatus = (int)OrderRechargeStatus.successful;
                    RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.successful);
                }
                else if (ste.Equals("2"))
                {
                    RechargeStatus = (int)OrderRechargeStatus.failure;
                    RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.failure);
                }
                else
                {//充值中
                }

                new SQLOrder().UpdateNotifyOrderBySql(oid, RechargeStatus, RechargeMsg);
            }
            else
            {
                WriteLog.Write("方法:RuiLian回调 本地系统订单号:" + oid +
                               "签名验证错误,Kamen数字签名" + sign + "本地签名:" + checkSign, LogPathFile.Other.ToString());
            }


            Response.Write("success");
        }
コード例 #29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string key = "427ee21dec9b49779f2cde44c4c04607";

            string businessId       = Request["businessId"];       //商户号 由平台分配每个商户唯一的一个商户号
            string userOrderId      = Request["userOrderId"];      //	商户订单号(流水号) 最大长度不超过32位的唯一流水号
            string status           = Request["status"];           //	充值结果 01  成功  02 失败
            string mes              = Request["mes"];              //	结果说明 对充值的结果予以说明,特别是充值失败的时候需要对具体充值失败原因简单说明一下
            string kmInfo           = Request["kmInfo"];           //	卡密信息 json字符串数组,格式为[{“cardNo” : “1234567”,”cardPwd” : “7654321”,”outDate”:”2015-12-29”},{“cardNo” : “1234567”,”cardPwd” : “7654321” ,”outDate”:”2015-12-29”}],密码要加密(采用3DES加密方式)
            string payoffPriceTotal = Request["payoffPriceTotal"]; //	结算总金额 系统和进货平台结算金额
            string sign             = Request["sign"];             //	签名 case(md5(businessId + userOrderId + status +密钥))


            WriteLog.Write("方法:PanSuo回调,userOrderId:" + userOrderId + " status:" + status +
                           "mes:" + mes, LogPathFile.Other.ToString());

            string md5str = businessId + userOrderId + status + key;

            string checkSign = Md5Helper.MD5Encrypt(md5str);

            if (sign == checkSign)
            {
                int    RechargeStatus = (int)OrderRechargeStatus.processing;
                string RechargeMsg    = string.Empty;

                if (status.Equals("01"))
                {
                    RechargeStatus = (int)OrderRechargeStatus.successful;
                    RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.successful);
                }
                else if (status.Equals("02"))
                {
                    RechargeStatus = (int)OrderRechargeStatus.failure;
                    RechargeMsg    = EnumService.GetDescription(OrderRechargeStatus.failure);
                }
                else
                {//充值中
                }

                new SQLOrder().UpdateNotifyOrderBySql(userOrderId, RechargeStatus, RechargeMsg);
            }
            else
            {
                WriteLog.Write("方法:PanSuo回调 本地系统订单号:" + userOrderId +
                               "签名验证错误,PanSuo数字签名" + sign + "本地签名:" + checkSign, LogPathFile.Other.ToString());
            }


            Response.Write("<receive>ok</receive>");
        }
コード例 #30
0
ファイル: AccessRightController.cs プロジェクト: huseynhe/ITS
        private List <AccessRightDTO> FillDescriptions(List <AccessRightDTO> ARCS)
        {
            IEnumerable <SelectListItem> ControllerList = EnumService.GetControllers();
            IEnumerable <SelectListItem> ActionList;

            foreach (AccessRightDTO ARC in ARCS)
            {
                ARC.ContollerDescription = ControllerList.Where(c => c.Value == ARC.AccessRightObj.Controller).Select(c => c.Text).FirstOrDefault();
                ActionList            = EnumService.GetActions(ARC.AccessRightObj.Controller);
                ARC.ActionDescription = ActionList.Where(a => a.Value == ARC.AccessRightObj.Action).Select(a => a.Text).FirstOrDefault();
            }
            ARCS = ARCS.OrderBy(u => u.AccessRightObj.Controller).ToList();
            return(ARCS);
        }