/// <summary> /// 作废 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnBatchDelete_Click(object sender, EventArgs e) { IEnumerable <string> selectIds = GetSelectIds(); try { Log(string.Format(@"作废单据号:{0}成功。", selectIds)); // foreach (var ids in selectIds) { var status = new LHBillStatus(); status.FCompanyId = CurrentUser.AccountComId; status.FDeptId = CurrentUser.AccountOrgId; status.FDate = DateTime.Now; status.FOperator = CurrentUser.AccountName; status.FActionName = EnumDescription.GetFieldText(GasEnumBillStauts.Voided); status.KeyId = ids; status.FMemo = string.Format("单据号{0}被{1}作废处理。", ids, CurrentUser.AccountName); GasHelper.AddBillStatus(status); var parms = new Dictionary <string, object>(); parms.Clear(); parms.Add("@KeyId", ids); parms.Add("@companyId", CurrentUser.AccountComId); parms.Add("@Bill", 1); SqlService.ExecuteProcedureNonQuery("proc_DeleteFlag", parms); } StockOutService.Update(p => p.FCompanyId == CurrentUser.AccountComId && selectIds.Contains(p.KeyId), p => new LHStockOut { FFlag = 0, // FStatus = Convert.ToInt32(GasEnumBillStauts.Voided), // FProgress = Convert.ToInt32(GasEnumBillStauts.Voided) }); //PassCardService.Update(p =>p.FCompanyId == CurrentUser.AccountComId && selectIds.Contains(p.KeyId), p => new LHPassCard //{ // FFlag = 0, // // FStatus = Convert.ToInt32(GasEnumBillStauts.Add), // // FProgress = Convert.ToInt32(GasEnumBillStauts.Add) //}); Alert.Show("作废成功!", MessageBoxIcon.Information); BindDataGrid(); } catch (Exception) { Alert.Show("作废失败!", MessageBoxIcon.Warning); } }
/// <summary> /// 订单处理 /// </summary> /// <param name="paymentOrderId">支付单号</param> private static void OrderHandler(long paymentOrderId) { ResultModel result = null; try { AddOrderInfoView addOrderInfoView = MemCacheFactory.GetCurrentMemCache().GetCache <AddOrderInfoView>("ZF" + paymentOrderId); if (addOrderInfoView == null) { _logger.Error(typeof(OrderMQ), string.Format("未找到支付编号【{0}】的订单信息", paymentOrderId)); return; } switch ((OrderEnums.PurchaseType)addOrderInfoView.PurchaseType) { case OrderEnums.PurchaseType.Normal: default: result = _orderService.GenerateNormalOrder(addOrderInfoView); break; case OrderEnums.PurchaseType.Outright: result = _orderService.GenerateOutrightOrder(addOrderInfoView); break; } //订单处理成功 if (result.IsValid && result.Status == (int)OrderEnums.GenerateOrderFailType.Success) { _logger.Error(typeof(OrderMQ), string.Format("支付编号【{0}】的订单已经成功处理", paymentOrderId)); } else { _logger.Error(typeof(OrderMQ), string.Format("支付编号【{0}】的订单失败:{1}", paymentOrderId, EnumDescription.GetFieldText((OrderEnums.GenerateOrderFailType)result.Status))); } } catch (Exception ex) { result = new ResultModel() { Status = (int)OrderEnums.GenerateOrderFailType.Fail, }; _logger.Error(typeof(OrderMQ), string.Format("支付编号【{0}】的订单处理异常:{1}", paymentOrderId, ex.Message)); } finally { bool flag = MemCacheFactory.GetCurrentMemCache().AddCache("DDJG" + paymentOrderId, result, 24 * 60); MemCacheFactory.GetCurrentMemCache().ClearCache("ZF" + paymentOrderId); } }
/// <summary> /// 作废 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnBatchDelete_Click(object sender, EventArgs e) { IEnumerable <string> selectIds = GetSelectIds(); try { Log(string.Format(@"作废单据号:{0}成功。", selectIds)); using (var trans = new TransactionScope()) { // foreach (var ids in selectIds) { var status = new LHBillStatus(); status.FCompanyId = CurrentUser.AccountComId; status.FDeptId = CurrentUser.AccountOrgId; status.FDate = DateTime.Now; status.FOperator = CurrentUser.AccountName; status.FActionName = EnumDescription.GetFieldText(GasEnumBillStauts.Voided); status.KeyId = ids; status.FMemo = string.Format("单据号{0}被{1}作废处理。", ids, CurrentUser.AccountName); GasHelper.AddBillStatus(status); } LeaseService.Update(p => selectIds.Contains(p.KeyId), p => new LHLease { FFlag = 0, // FStatus = Convert.ToInt32(GasEnumBillStauts.Voided), // FProgress = Convert.ToInt32(GasEnumBillStauts.Voided) }); foreach (var ids in selectIds) { var parms = new Dictionary <string, object>(); parms.Clear(); parms.Add("@keyID", ids); parms.Add("@companyId", CurrentUser.AccountComId); SqlService.ExecuteProcedureCommand("proc_LeaseKillSK", parms); } trans.Complete(); } Alert.Show("作废成功!", MessageBoxIcon.Information); BindDataGrid(); } catch (Exception) { Alert.Show("作废失败!", MessageBoxIcon.Warning); } }
public LQPayRequest(OnLinePayOrder onLinePayOrder, string type = "weixin") : this(onLinePayOrder.OrderID) { LQPayContent content = new LQPayContent() { channelType = type, body = $"{onLinePayOrder.Score} 颗 {EnumDescription.GetFieldText(AppConfig.PayScoreType.Diamond)}", money = (onLinePayOrder.Amount * 100).ToString("F0"), userId = onLinePayOrder.GameID.ToString(), userIp = GameRequest.GetUserIP(), userSourceType = "Android", channelCode = "" }; AddParamValue("pay_content", content.ToString().Replace("\\", "")); }
//string defaultTxt public static List <SelectListItem> PopulateDropdown <T>(string defaultTxt) { var selectList = new List <SelectListItem>(); selectList.Add(new SelectListItem { Text = "请选择", Value = "0", Selected = true }); foreach (object s in Enum.GetValues(typeof(T))) { selectList.Add(new SelectListItem { Text = EnumDescription.GetFieldText(s), Value = ((int)s).ToString() }); } return(selectList); }
/// <summary> /// 添加 用户充值订单表(第三方用户没有返汇前添加) /// </summary> /// <param name="RechargeAmount">充值金额</param> /// <param name="Radiochecked">第三方充值方式通道</param> /// <param name="UserID">用户ID</param> /// <param name="OrderSource">来源0:网站,1移动设备</param> /// <param name="OrderNO">用户充值订单表ID</param> /// <param name="PaymentOrderID">订单支付信息表ID</param> /// <returns></returns> public ResultModel InsertAddZJ_RechargeOrder(AccountRechargeModel armodel, ERechargeOrderPrefix prefix, out string OrderNO, out string PaymentOrderID) { var result = new ResultModel(); #region 用户充值订单表 ZJ_RechargeOrderModel zjroModel = new ZJ_RechargeOrderModel(); zjroModel.CreateDT = DateTime.Now; zjroModel.IsDisplay = 1; zjroModel.OrderNO = EnumDescription.GetFieldText(prefix) + MemCacheFactory.GetCurrentMemCache().Increment("commonId").ToString();//这里是为了区分商品订单还是充值订单 zjroModel.OrderSource = armodel.OrderSource; zjroModel.RechargeAmount = armodel.AddOrCutAmount; zjroModel.RechargeChannel = armodel.RechargeChannel; zjroModel.RechargeDT = DateTime.Now; zjroModel.RechargeResult = 0;//默认是失败的 zjroModel.UserID = armodel.UserID; OrderNO = zjroModel.OrderNO; #endregion #region 订单支付信息表 //订单支付信息表 PaymentOrderModel poModel = new PaymentOrderModel(); poModel.Flag = 1; poModel.outOrderId = ""; poModel.PaymentDate = DateTime.Now; poModel.PaymentOrderID = MemCacheFactory.GetCurrentMemCache().Increment("commonId").ToString(); poModel.PayType = 2;//支付类型(1:商城订单支付,2充值支付) poModel.ProductAmount = armodel.AddOrCutAmount; poModel.RealAmount = armodel.AddOrCutAmount; poModel.UserID = armodel.UserID; poModel.CreateDT = DateTime.Now; poModel.PayChannel = armodel.RechargeChannel; //订单支付信息与订单关联记录表 PaymentOrder_OrdersModel pooModel = new PaymentOrder_OrdersModel(); pooModel.OrderID = zjroModel.OrderNO; pooModel.RelateID = MemCacheFactory.GetCurrentMemCache().Increment("commonId"); pooModel.PaymentOrderID = poModel.PaymentOrderID; #endregion result = _zjUserBalanceServiceWeb.AccountRechargeFailure(zjroModel, pooModel, poModel); PaymentOrderID = poModel.PaymentOrderID; return(result); }
/// <summary> /// 获取代理设置列表 /// </summary> /// <param name="para"></param> /// <param name="searchValue"></param> /// <returns></returns> public JsonResult GetAgentSetList(DataTableParameter para, string searchValue) { int total = 0; var dataList = GetAgentSetList(Userinfo, out total, para, searchValue); if (dataList != null) { foreach (var item in dataList) { string strHtml = "<div class='row'><div class='col-md-8'>{0}</div><div class='col-md-4' style='text-align:right'>{1}</div></div>"; string linkAList = "<a class='glyphicon glyphicon-pencil edit' title='修改' Id='" + item.id + "'></a>"; linkAList += " " + "<a class='glyphicon glyphicon-eye-open detail' title='详情' id='" + item.id + "' ></a>"; strHtml = string.Format(strHtml, item.b_DelegateName, linkAList); item.b_DelegateName = strHtml; if (!string.IsNullOrEmpty(item.b_StartDateMinute)) { item.b_StartDate = item.b_StartDate + " " + item.b_StartDateMinute; } if (!string.IsNullOrEmpty(item.b_EndDateMinute)) { item.b_EndDate = item.b_EndDate + " " + item.b_EndDateMinute; } item.AgentModuleList = new List <string>(item.b_AgentContent.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries)); if (item.AgentModuleList.Count > 0) { string agentContext = ""; foreach (var agentModule in item.AgentModuleList) { string value = EnumDescription.GetFieldText(EnumDescription.GetEnumByTextUseDefault <AgentModule>(agentModule)); agentContext = agentContext + value + ";"; } item.b_AgentContent = agentContext; } } } return(Json(new { sEcho = para.sEcho, iTotalRecords = total, iTotalDisplayRecords = total, aaData = dataList }, JsonRequestBehavior.AllowGet)); }
public int SeatAdd(mSeat newseat) { Seat seat = new Seat(); seat_repo.Add(newseat.ToDb(seat)); SubmitChanges(); Auth useseatauth = new Auth { name = EnumDescription.GetFieldText(eAuthType.UseSeat) + " - " + seat.name, type = (int)eAuthType.UseSeat, key1 = seat.id }; auth_repo.Add(useseatauth); Auth editseatauth = new Auth { name = EnumDescription.GetFieldText(eAuthType.EditSeat) + " - " + seat.name, type = (int)eAuthType.EditSeat, key1 = seat.id }; auth_repo.Add(editseatauth); foreach (eSelpropType etype in Enum.GetValues(typeof(eSelpropType))) { Auth selpropauth = new Auth { name = EnumDescription.GetFieldText(eAuthType.UseSeatProp) + " - " + EnumDescription.GetFieldText(etype) + " - " + seat.name, type = (int)eAuthType.UseSeatProp, key1 = seat.id, key2 = (int)etype }; auth_repo.Add(selpropauth); } foreach (eItemPropType etype in Enum.GetValues(typeof(eItemPropType))) { Auth itempropauth = new Auth { name = EnumDescription.GetFieldText(eAuthType.UseSeatProp) + " - " + EnumDescription.GetFieldText(etype) + " - " + seat.name, type = (int)eAuthType.UseSeatProp, key1 = seat.id, key2 = (int)etype }; auth_repo.Add(itempropauth); } SubmitChanges(); return(seat.id); }
/// <summary> /// 删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnBatchDelete_Click(object sender, EventArgs e) { IEnumerable <string> selectIds = GetSelectIds(); try { Log(string.Format(@"作废单据号:{0}成功。", selectIds)); //StockInService.Update(p => selectIds.Contains(p.KeyId), p => new LHStockIn { FFlag = 0 }); // foreach (string ids in selectIds) { LHBillStatus status = new LHBillStatus { FCompanyId = CurrentUser.AccountComId, FDeptId = CurrentUser.AccountOrgId, FDate = DateTime.Now, FOperator = CurrentUser.AccountName, FActionName = EnumDescription.GetFieldText(GasEnumBillStauts.Voided), KeyId = ids, FMemo = string.Format("单据号{0}被{1}作废处理。", ids, CurrentUser.AccountName) }; GasHelper.AddBillStatus(status); } StockInService.Update(p => selectIds.Contains(p.KeyId), p => new LHStockIn { FFlag = 0, // FStatus = Convert.ToInt32(GasEnumBillStauts.Voided), // FProgress = Convert.ToInt32(GasEnumBillStauts.Voided) }); Alert.Show("作废成功!", MessageBoxIcon.Information); BindDataGrid(); } catch (Exception) { Alert.Show("作废失败!", MessageBoxIcon.Warning); } }
/// <summary> /// 获取任务状态 /// </summary> /// <returns></returns> public string GetTaskNodeStatus(BsonDocument task, List <BsonDocument> designTasks, List <BsonDocument> sysTasks) { var taskstatus = CommonTaskStatus.NotStarted; var curStatusName = EnumDescription.GetFieldText(taskstatus); switch (task.Int("nodeType")) { case (int)TaskNodeType.SelfDefinedTask: case (int)TaskNodeType.LastMonthUnfinishedTask: //自定义与上个月未完成任务 curStatusName = EnumDescription.GetFieldText((MonthlyTaskStatus)task.Int("taskStatus")); break; case (int)TaskNodeType.DesignTask: //项目设计计划 var designTask = designTasks.Where(c => c.String("taskId") == task.String("taskId")).FirstOrDefault(); if (designTask != null) { var curTaskStatus = designTask.Int("status", 2); if (curTaskStatus < (int)TaskStatus.NotStarted) { curTaskStatus = (int)TaskStatus.NotStarted; } curStatusName = EnumDescription.GetFieldText((TaskStatus)curTaskStatus); double delayDay = 0; if (curTaskStatus < (int)TaskStatus.Completed && designTask.Date("curEndData") != DateTime.MinValue && designTask.Date("curEndData") < DateTime.Now) //延迟结束 { curTaskStatus = -1; curStatusName = "已延迟"; delayDay = (DateTime.Now - task.Date("curEndData")).TotalDays; } } break; case (int)TaskNodeType.SystemTask: //系统设计计划 var sysTask = sysTasks.Where(c => c.String("systaskId") == task.String("systaskId")).FirstOrDefault(); if (sysTask != null) { curStatusName = EnumDescription.GetFieldText((SysTaskStatus)sysTask.Int("state")); } break; } return(curStatusName); }
public ActionResult Save(CourseInfoEditDto input) { try { var createOrUpdate = new CreateOrUpdateCourseInfoInput(); input.TypeName = EnumDescription.GetFieldText((CourseType)input.Type); createOrUpdate.CourseInfoEditDto = input; if (input.Content != null) { input.Content = input.Content.Replace(Environment.NewLine, "<br>"); } if (input.Content != "") { createOrUpdate.CourseInfoEditDto.Content = HttpUtility.HtmlDecode(input.Content); } _coreInfoService.CreateOrUpdateCourseInfo(createOrUpdate); return(RedirectToAction("/Index")); } catch (Exception ex) { } return(RedirectToAction("/CreateAndEdite", input)); }
public LQPayRequest(OnLinePayOrder onlineOrder, string uuid, string userid) : this(onlineOrder.OrderID) { LQPrePayContent content = new LQPrePayContent() { code = "001", comment = $"{onlineOrder.Score} 颗 {EnumDescription.GetFieldText(AppConfig.PayScoreType.Diamond)}", name = "钻石", price = (onlineOrder.Amount / onlineOrder.Score * 100).ToString("F0"), quality = onlineOrder.Score.ToString(), realMoney = (onlineOrder.Amount * 100).ToString("F0"), rebateMoney = "0", totalMoney = (onlineOrder.Amount * 100).ToString("F0"), showUrl = "", unit = "颗" }; AddParamValue("uuid", uuid); AddParamValue("user_id", userid); AddParamValue("total_money", (onlineOrder.Amount * 100).ToString("F0")); AddParamValue("rebate_money", "0"); AddParamValue("real_money", (onlineOrder.Amount * 100).ToString("F0")); AddParamValue("pay_content", "[" + content + "]"); }
/// <summary> /// 保存数据 /// </summary> /// <returns></returns> public JsonResult SaveAgentSet(AgentSetModel model) { var retModel = new JsonReturnModel(); try { //限制输入的代理人不能为自己 if (model.b_AgentName == Userinfo.UserName) { retModel.AddError("errorMessage", "代理人选择不能为自己!"); return(Json(retModel, JsonRequestBehavior.AllowGet)); } var b_AgentName = IdentityDA.GetIdentityByKeyedName(inn, model.b_AgentName); if (b_AgentName.isError()) { retModel.AddError("errorMessage", "找不到对应的代理人!"); return(Json(retModel, JsonRequestBehavior.AllowGet)); } if (model.AgentModuleList == null || model.AgentModuleList.Count == 0) { retModel.AddError("errorMessage", "请您选择授权模块!"); return(Json(retModel, JsonRequestBehavior.AllowGet)); } string value = string.Join(";", model.AgentModuleList.ToArray()) + ";"; model.b_AgentContent = value; //验证输入的时间是否正确 string b_StartDate = !string.IsNullOrEmpty(model.b_StartDateMinute) ? model.b_StartDate + " " + model.b_StartDateMinute : model.b_StartDate; string b_EndDate = !string.IsNullOrEmpty(model.b_EndDateMinute) ? model.b_EndDate + " " + model.b_EndDateMinute : model.b_EndDate; DateTime StartDate; if (!DateTime.TryParse(b_StartDate, out StartDate)) { retModel.AddError("errorMessage", "输入的生效时间错误!"); return(Json(retModel, JsonRequestBehavior.AllowGet)); } DateTime EndDate; if (!DateTime.TryParse(b_EndDate, out EndDate)) { retModel.AddError("errorMessage", "输入的终止时间错误!"); return(Json(retModel, JsonRequestBehavior.AllowGet)); } Item item = null; if (string.IsNullOrEmpty(model.id)) { item = inn.newItem("b_AgentSet", "add"); } else { item = inn.newItem("b_AgentSet", "edit"); item.setAttribute("id", model.id); } item.setProperty("b_delegatename", model.b_DelegateName); item.setProperty("b_agentname", model.b_AgentName); item.setProperty("b_startdate", model.b_StartDate); item.setProperty("b_startdateminute", model.b_StartDateMinute); item.setProperty("b_enddate", model.b_EndDate); item.setProperty("b_enddateminute", model.b_EndDateMinute); item.setProperty("b_agentcontent", model.b_AgentContent); item.setProperty("b_isvalid", model.b_IsValid); item.setProperty("b_agentreason", model.b_AgentReason); var result = item.apply(); if (result.isError()) { retModel.AddError("errorMessage", result.getErrorString()); } else { if (model.b_IsValid == "1") { string agentContext = ""; if (model.AgentModuleList.Count > 0) { foreach (var agentModule in model.AgentModuleList) { string moduleStr = EnumDescription.GetFieldText(EnumDescription.GetEnumByTextUseDefault <AgentModule>(agentModule)); agentContext = agentContext + moduleStr + ";"; } } WorkFlowBll.SendAgentEmail(inn, model.b_DelegateName, model.b_AgentName, StartDate, EndDate, agentContext); } } } catch (Exception ex) { retModel.AddError("errorMessage", ex.Message); } return(Json(retModel, JsonRequestBehavior.AllowGet)); }
public static string GetIssueAreaDes(IssueArea status) { return(EnumDescription.GetFieldText(status)); }
public async Task start() { bool alwayCreateModel = true; //是否建立模型文档 string labelColumn = "RareDegree"; //需要计算的字段 student string[] oneHotColumns = new string[] { }; //oneHot编码字段 string[] features = new string[] { "FatherRareDegree", "MotherRareDegree", "TotalPoint" }; //特征列, "classCount" "student" var curTypeNameIndex = 4; //幼儿园 1小学 4中学 5大学 6驾校 7教育其他 var tableName = "MiTuProfile"; var tableNameEgg = "MiTu"; //条件筛选项 var conStr = GetConnectionStr("192.168.1.124", "CrawlerDataBase"); var dataop = new MongoRepositoryHelperA3(conStr); //训练评估查询语句 var query = Query.And(Query.EQ("isUpdate", 1)); //预测语句 var fields = new string[] { "id", "BODY_COLOR", "EYE", "EYE_COLOR", "FIGURE", "MOUTH", "PATTERN", "PATTERN_COLOR", "rareDegreeKey", "parents" }; var traningJiaMiTuList = new List <JiaMiTu>(); //训练数据 var evaluateJiaMiTuList = new List <JiaMiTu>(); //评估数据 PredictionModel <JiaMiTu, JiaMiTuPrediction> model = null; ///模型地址 var modelFileName = $"{ModelDirectory}/{string.Join("_", features)}-{labelColumn}.zip"; if (File.Exists(modelFileName)) { model = await PredictionModel.ReadAsync <JiaMiTu, JiaMiTuPrediction>(modelFileName); // await在你的Main方法中添加一个方法意味着该Main方法必须具有async修饰符并返回a Task: // using System.Threading.Tasks; // 评估模型 } else { if (model == null) { var allExistJiaMiTuDocList = dataop.FindByQuery(tableName, query).SetFields(fields).ToList(); var allCount = allExistJiaMiTuDocList.Count(); int traningCount = (int)(allCount * 0.7);//评估的数据源个数 ///加载模型需要数据 foreach (var traningJiaMiTu in allExistJiaMiTuDocList) { if (!traningJiaMiTu.Contains("parents")) { continue; } var parents = traningJiaMiTu["parents"] as BsonArray; if (parents.Count <= 1) { continue; } var father = parents[0] as BsonDocument; var mother = parents[1] as BsonDocument; var curJiaMiTu = InitialJiaMiTu(traningJiaMiTu); //赋值字段 //var fatherDoc = allExistJiaMiTuDocList.Where(c => c.Text("id") == father.Text("petId")).FirstOrDefault(); //var motherDoc = allExistJiaMiTuDocList.Where(c => c.Text("id") == mother.Text("petId")).FirstOrDefault(); var fatherDoc = dataop.FindOne(tableName, Query.EQ("id", father.Text("petId"))); var motherDoc = dataop.FindOne(tableName, Query.EQ("id", mother.Text("petId"))); if (fatherDoc == null || motherDoc == null) { continue; } //父亲 var fatherMiTu = InitialJiaMiTu(fatherDoc); //母亲 var motherMiTu = InitialJiaMiTu(motherDoc); //当前加密兔 curJiaMiTu = InitialJiaMiTuPoint(curJiaMiTu, fatherMiTu, motherMiTu);//计算得分 if (curJiaMiTu.TotalPoint <= 0) { continue; } if (traningJiaMiTuList.Count <= traningCount) { traningJiaMiTuList.Add(curJiaMiTu); } else { evaluateJiaMiTuList.Add(curJiaMiTu); } } //PredictionModel<JiaMiTu, JiaMiTuPrediction> model = TrainAsync(); //改变的返回类型Train方法意味着你必须一个补充await,以调用codde Train在Method下面的代码如下所示: model = await Train(traningJiaMiTuList, modelFileName, labelColumn, oneHotColumns, features, specialFields); } Evaluate(evaluateJiaMiTuList, model); } var prediction1 = model.Predict(TestTrips.Trip1); Console.WriteLine("确认模型后按回车开始"); // var query = Query.And(Query.Exists("student", true), Query.Exists("teacher", true), Query.Exists("classCount", false)); var allJiaMiTuList = dataop.FindByQuery(tableNameEgg, Query.And(Query.Exists("pIds", true), Query.NE("isPredic", 1), Query.NE("isPass", 1))).ToList(); var ExecNum = Guid.NewGuid().ToString(); var index = 1; foreach (var JiaMiTu in allJiaMiTuList) { /// 比如没有班级字段通过模型的学生和老师个数来预测班级数 var id = JiaMiTu.Text("id"); var pIds = JiaMiTu["pIds"] as BsonArray; var fatherDoc = dataop.FindOne(tableName, Query.EQ("id", pIds[0].ToString())); var motherDoc = dataop.FindOne(tableName, Query.EQ("id", pIds[1].ToString())); if (fatherDoc == null || motherDoc == null) { continue; } var doc = new BsonDocument(); doc.Set("ExecNum", ExecNum); //父亲 var fatherMiTu = InitialJiaMiTu(fatherDoc); //母亲 var motherMiTu = InitialJiaMiTu(motherDoc); //当前加密兔 var Trip1 = InitialJiaMiTu(JiaMiTu); //赋值字段 Trip1 = InitialJiaMiTuPoint(Trip1, fatherMiTu, motherMiTu); //计算得分 if (motherMiTu.RareDegree >= (int)RareDegree.rare && fatherMiTu.RareDegree <= (int)RareDegree.rare || fatherMiTu.RareDegree >= (int)RareDegree.rare && motherMiTu.RareDegree <= (int)RareDegree.rare) { var prediction = model.Predict(Trip1); if (prediction.RareDegree != 0) { string txt = EnumDescription.GetFieldText((RareDegree)prediction.RareDegree); doc.Add($"{labelColumn}Predic", prediction.RareDegree); doc.Add($"{labelColumn}PredicTxt", txt);//总得分 if (txt != doc.Text("rareDegree")) { } #region 操作日志字段 doc.Add("isPredic", 1); //是否预测字段 doc.Add("point", Trip1.TotalPoint); //总得分 DBChangeQueue.Instance.EnQueue(new StorageData() { Name = tableNameEgg, Document = doc, Query = Query.EQ("_id", ObjectId.Parse(JiaMiTu.Text("_id"))), Type = StorageType.Update }); #endregion } Console.WriteLine($"fatherRareDegree:{fatherMiTu.RareDegree}motherRareDegree{motherMiTu.RareDegree} predic:{prediction.RareDegree} id:{id}"); } else { doc.Add("isPass", 1);//是否预测字段 DBChangeQueue.Instance.EnQueue(new StorageData() { Name = tableNameEgg, Document = doc, Query = Query.EQ("_id", ObjectId.Parse(JiaMiTu.Text("_id"))), Type = StorageType.Update }); } index++; if (index % 100 == 0) { Console.WriteLine("剩余处理{0}{1}", allJiaMiTuList.Count - index, ExecNum); } } StartDBChangeProcessQuick(dataop); Console.WriteLine("操作结束" + ExecNum); }
/// <summary> /// 充值类型 /// </summary> /// <param name="shareId"></param> /// <returns></returns> public string GetOrderShareName(int shareId) { return(EnumDescription.GetFieldText((AppConfig.ShareType)shareId)); }
/// <summary> /// 获取描述 /// </summary> /// <param name="status"></param> /// <returns></returns> public static string GetServiceAreaDes(ServiceArea status) { return(EnumDescription.GetFieldText(status)); }
public void Log(string errorType, string msg, string location, ErrorLevel level) { try { if (!this.enabled) { return; } string ss = string.Format("\n{0} : {1} -- {2} 。错误类型:{3}。位置:{4}", DateTime.Now.ToString(), EnumDescription.GetFieldText(level), msg, errorType, location); this.FileLogger.Log(ss); } catch (Exception ee) { ee = ee; } }
public static string GetGamePropertyKindDes(GamePropertyKind kind) { return(EnumDescription.GetFieldText(kind)); }
/// <summary> /// 获取管理权限描述 /// </summary> /// <param name="status"></param> /// <returns></returns> public static string GetMasterRightDes(MasterRightHelper status) { return(EnumDescription.GetFieldText(status)); }
/// <summary> /// 提交 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void btnPay_Click(object sender, EventArgs e) { string strAccounts = CtrlHelper.GetText(txtPayAccounts); string strReAccounts = CtrlHelper.GetText(txtPayReAccounts); string strCardNumber = CtrlHelper.GetText(txtCardNumber); string strCardPassword = CtrlHelper.GetText(txtCardPassword); int amount = Convert.ToInt32(ddlAmount.SelectedValue); if (strAccounts == "") { RenderAlertInfo(true, "抱歉,请输入充值帐号。", 2); return; } if (strReAccounts != strAccounts) { RenderAlertInfo(true, "抱歉,两次输入的帐号不一致。", 2); return; } if (amount == 0) { RenderAlertInfo(true, "请选择卡面值。", 2); return; } if (string.IsNullOrEmpty(strCardNumber)) { RenderAlertInfo(true, "抱歉,请输入卡号。", 2); return; } if (string.IsNullOrEmpty(strCardPassword)) { RenderAlertInfo(true, "抱歉,请输入卡密码。", 2); return; } OnLineOrder onlineOrder = new OnLineOrder(); onlineOrder.ShareID = cardType; onlineOrder.OrderID = PayHelper.GetOrderIDByPrefix("JFTCard"); if (Fetch.GetUserCookie() == null) { onlineOrder.OperUserID = 0; } else { onlineOrder.OperUserID = Fetch.GetUserCookie().UserID; } onlineOrder.Accounts = strAccounts; onlineOrder.OrderAmount = amount; onlineOrder.IPAddress = GameRequest.GetUserIP(); //生成订单 Message umsg = FacadeManage.aideTreasureFacade.RequestOrder(onlineOrder); if (!umsg.Success) { RenderAlertInfo(true, umsg.Content, 2); return; } // 商户ID string p1_usercode = ApplicationSettings.Get("jftBankID"); // 秘钥 string key = ApplicationSettings.Get("jftBankKey"); // 回调页面 string p4_returnurl = "http://" + HttpContext.Current.Request.Url.Authority + "/Pay/JFT/CardReturn.aspx"; // 通知地址 string p5_notifyurl = "http://" + HttpContext.Current.Request.Url.Authority + "/Pay/JFT/PublicAdvice.aspx"; // 请求时间 string p6_ordertime = DateTime.Now.ToString("yyyyMMddHHmmss"); // 签名信息 string strEncryption = string.Format("{0}&{1}&{2}&{3}&{4}&{5}{6}", p1_usercode, onlineOrder.OrderID, amount, p4_returnurl, p5_notifyurl, p6_ordertime, key ); string p7_sign = Utility.MD5(strEncryption).ToUpper(); // 加密方法 string p8_signtype = ""; // 商户支付方式 string p9_paymethod = "5"; // 支付通道编码 string p10_paychannelnum = EnumDescription.GetFieldText(typeof(AppConfig.JFTPayCardType), cardType); // 商户进行支付的银行卡类型 string p11_cardtype = ""; // 银行支付类型 string p12_channel = ""; // 订单失效时间 string p13_orderfailertime = ""; // 客户或卖家名称 string p14_customname = ""; // 客户联系方式类型 1、email,2、phone,3、地址 string p15_customcontacttype = ""; // 客户联系方式 string p16_customcontact = ""; // 客户IP地址 string p17_customip = ""; // 商品名称 string p18_product = ""; // 卡密 string p19_productcat = strCardPassword; // 卡号 string p20_productnum = strCardNumber; // 商品描述 string p21_pdesc = ""; // 接口版本 string p22_version = "2.0"; // 编码类型 string p23_charset = ""; // 备注信息 string p24_remark = ""; #region 整理参数 RenderAlertInfo(false, "页面正跳转到支付平台,请稍候。。。", 2); StringBuilder builder = new StringBuilder(); builder.AppendLine(CreateInputHidden("p1_usercode", p1_usercode)); builder.AppendLine(CreateInputHidden("p2_order", onlineOrder.OrderID)); builder.AppendLine(CreateInputHidden("p3_money", amount.ToString())); builder.AppendLine(CreateInputHidden("p4_returnurl", p4_returnurl)); builder.AppendLine(CreateInputHidden("p5_notifyurl", p5_notifyurl)); builder.AppendLine(CreateInputHidden("p6_ordertime", p6_ordertime)); builder.AppendLine(CreateInputHidden("p7_sign", p7_sign)); builder.AppendLine(CreateInputHidden("p8_signtype", p8_signtype)); builder.AppendLine(CreateInputHidden("p9_paymethod", p9_paymethod)); builder.AppendLine(CreateInputHidden("p10_paychannelnum", p10_paychannelnum)); builder.AppendLine(CreateInputHidden("p11_cardtype", p11_cardtype)); builder.AppendLine(CreateInputHidden("p12_channel", p12_channel)); builder.AppendLine(CreateInputHidden("p13_orderfailertime", p13_orderfailertime)); builder.AppendLine(CreateInputHidden("p14_customname", p14_customname)); builder.AppendLine(CreateInputHidden("p15_customcontacttype", p15_customcontacttype)); builder.AppendLine(CreateInputHidden("p16_customcontact", p16_customcontact)); builder.AppendLine(CreateInputHidden("p17_customip", p17_customip)); builder.AppendLine(CreateInputHidden("p18_product", p18_product)); builder.AppendLine(CreateInputHidden("p19_productcat", p19_productcat)); builder.AppendLine(CreateInputHidden("p20_productnum", p20_productnum)); builder.AppendLine(CreateInputHidden("p21_pdesc", p21_pdesc)); builder.AppendLine(CreateInputHidden("p22_version", p22_version)); builder.AppendLine(CreateInputHidden("p23_charset", p23_charset)); builder.AppendLine(CreateInputHidden("p24_remark", p24_remark)); formData = builder.ToString(); #endregion js = "<script>window.onload = function() { document.forms[0].submit(); }</script>"; }
public static string GetPermissionDes(Permission permission) { return(EnumDescription.GetFieldText(permission)); }
/// <summary> /// 导出凭证清单 /// </summary> /// <param name="searchValue"></param> /// <param name="startTime"></param> /// <param name="endTime"></param> /// <param name="status"></param> /// <returns></returns> public FileResult ExportTripReimbursementByCondition(string searchValue, DateTime?startTime, DateTime?endTime, string status) { List <ApiExpenseReimbursementEntity> list = new List <ApiExpenseReimbursementEntity>(); int total = 0; var dataList = GetSearchTripReimbursementList(inn, Userinfo.Roles, out total, null, startTime, endTime, searchValue, status, Userinfo.UserName); if (dataList != null) { foreach (var item in dataList) { if (string.IsNullOrEmpty(item.status)) { item.status = "End"; } if (item.status == "Expense Accountant Creation" || item.status == "End") { List <ApiExpenseReimbursementEntity> datas = TripReimbursementBll.SendTripReimbursementCreation(inn, item.id); if (datas != null) { List <ApiExpenseReimbursementEntity> newApiEntity = new List <ApiExpenseReimbursementEntity>(); foreach (var data in datas) { if (data.b_TaxRate > 0) { int rateInt = int.Parse((data.b_TaxRate.Value * double.Parse("100")).ToString()); TaxCodeTypeList?obj = EnumDescription.GetEnumByValue <TaxCodeTypeList>(rateInt); string textDescription = EnumDescription.GetFieldText(obj); //根据描述获取对应的科目 string subject = TaxCodeConfigureBll.GeTaxCodeConfigureByText(textDescription); data.DMBTR = data.b_TaxFreeAmount; ApiExpenseReimbursementEntity entity = new ApiExpenseReimbursementEntity(); entity.BUKRS = data.BUKRS; entity.XBLNR = data.XBLNR; entity.BLDAT = data.BLDAT; entity.BUDAT = data.BUDAT; entity.BKTXT = data.BKTXT; entity.NUMPG = data.NUMPG; entity.PROTYP = data.PROTYP; entity.POSID = data.POSID; entity.HKONT = subject; entity.DMBTR = data.b_Tax; entity.KOSTL = ""; entity.SGTXT = data.SGTXT; entity.AUFNR = data.AUFNR; newApiEntity.Add(data); newApiEntity.Add(entity); } else { newApiEntity.Add(data); } } //计算合计金额 ApiExpenseReimbursementEntity totalEntity = new ApiExpenseReimbursementEntity(); totalEntity.BUKRS = newApiEntity.First().BUKRS; totalEntity.XBLNR = newApiEntity.First().XBLNR; totalEntity.BLDAT = newApiEntity.First().BLDAT; totalEntity.BUDAT = newApiEntity.First().BUDAT; totalEntity.BKTXT = newApiEntity.First().b_StaffNo; totalEntity.HKONT = "2241999999"; totalEntity.DMBTR = newApiEntity.Select(x => x.DMBTR).Sum(); newApiEntity.Add(totalEntity); list.AddRange(newApiEntity); } } } } Stream ms = ExportTripReimbursementByData(list); return(File(ms, "application/vnd.ms-excel", "凭证清单" + ".xls")); }
/// <summary> /// 获取描述 /// </summary> /// <param name="status"></param> /// <returns></returns> public static string GetMemberOrderStatusDes(MemberOrderStatus status) { return(EnumDescription.GetFieldText(status)); }
/// <summary> /// 作废 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnBatchDelete_Click(object sender, EventArgs e) { IEnumerable <string> selectIds = GetSelectIds(); try { Log(string.Format(@"作废单据号:{0}成功。", selectIds)); using (var trans = new TransactionScope()) { // foreach (var ids in selectIds) { var status = new LHBillStatus(); status.FCompanyId = CurrentUser.AccountComId; status.FDeptId = CurrentUser.AccountOrgId; status.FDate = DateTime.Now; status.FOperator = CurrentUser.AccountName; status.FActionName = EnumDescription.GetFieldText(GasEnumBillStauts.Voided); status.KeyId = ids; status.FMemo = string.Format("单据号{0}被{1}作废处理。", ids, CurrentUser.AccountName); GasHelper.AddBillStatus(status); } LeaseReturnService.Update(p => p.FCompanyId == CurrentUser.AccountComId && selectIds.Contains(p.KeyId), p => new LHLeaseReturn { FFlag = 0, // FStatus = Convert.ToInt32(GasEnumBillStauts.Voided), // FProgress = Convert.ToInt32(GasEnumBillStauts.Voided) }); foreach (var ids in selectIds) { var parms = new Dictionary <string, object>(); parms.Clear(); parms.Add("@keyID", ids); parms.Add("@companyId", CurrentUser.AccountComId); var data = SqlService.ExecuteProcedureCommand("proc_LeaseKill", parms).Tables[0]; for (int i = 0; i < data.Rows.Count; i++) { int id = Convert.ToInt32(data.Rows[i]["FDetailsFId"]); int qty = Convert.ToInt32(data.Rows[i]["FBottleQty"]); var details = LeaseDetailsService.FirstOrDefault(p => p.FId == id); details.FReturnQty = details.FReturnQty - qty; LeaseDetailsService.SaveChanges(); } } trans.Complete(); } Alert.Show("作废成功!", MessageBoxIcon.Information); BindDataGrid(); } catch (Exception) { Alert.Show("作废失败!", MessageBoxIcon.Warning); } }
/// <summary> /// 验证不允许在 enums 范围内 /// </summary> /// <param name="field"></param> /// <param name="enums"></param> /// <returns></returns> public static EnumField NotIn(this EnumField field, params Enum[] enums) { if (field.ShouldValidate) { if (enums.Any(t => t.Equals(field.Value))) { throw new ValidationException(string.Format("{0}:不允许是{1}!", field.DisplayName, enums.Montage(t => EnumDescription.GetFieldText(t), "、"))); } } return(field); }
/// <summary> /// 根据枚举的类型和值获取描述 /// </summary> /// <param name="value"></param> /// <returns></returns> public static string GetDesc(object value) { return(EnumDescription.GetFieldText(value)); }
/// <summary> /// 验证必须在 enums 范围内 /// </summary> /// <param name="field"></param> /// <param name="enums"></param> /// <returns></returns> public static EnumField In(this EnumField field, params Enum[] enums) { if (field.ShouldValidate) { if (enums.Any(t => t.Equals(field.Value)) == false) { throw new ValidationException(string.Format("{0}:必须是{1}{2}!", field.DisplayName, enums.Montage(t => EnumDescription.GetFieldText(t), "、"), (enums.Count() >= 2? "之一" : string.Empty))); } } return(field); }
public void Log(string errorType, string msg, string location, ErrorLevel level) { try { if (this.enabled) { string str = string.Format("\n{0} : {1} -- {2} 。错误类型:{3}。位置:{4}", new object[] { DateTime.Now.ToString(), EnumDescription.GetFieldText(level), msg, errorType, location }); this.FileLogger.Log(str); } } catch (Exception exception) { exception = exception; } }
/// <summary> /// 获取用户权限描述 /// </summary> /// <param name="status"></param> /// <returns></returns> public static string GetUserRightDes(UserRightStatus status) { return(EnumDescription.GetFieldText(status)); }