private void checkHasCarIn() { if (Visibility != Visibility.Visible) { checkTP.stop(); return; } bool hasCarIn = MS2.IfHasCarIn(); if (Visibility != Visibility.Visible) { checkTP.stop(); return; } if (hasCarIn == false) { if (nextStep == null) { TH.addOnceUI(BackExit.Exit); } else { TH.addOnceUI(nextStep); } checkTP.stop(); } }
private void checkPsw() { stop = false; TH.addOnceData(checkAnimation); Thread.Sleep(2000); StringBuilder psw = new StringBuilder(); foreach (string s in ps) { psw.Append(s); } if (psw.ToString() == testPassword) { TH.addOnceUI(new Action(() => { Visibility = Visibility.Hidden; if (nextStep != null) { nextStep(); } tip.Text = ""; foreach (Label l in p) { l.Content = ""; } ps.Clear(); index = 0; })); } else { stop = true; } }
private void btnSupprTh_Click(object sender, EventArgs e) { try { int i = cbxSelectTh.SelectedIndex; Theme TH; TH = Theme.listeThemes().ElementAt(i); TH.supprimerTheme(); cbxSelectTh.ResetText(); txbNomTh2.Clear(); cbxSelectAt3.ResetText(); lblDeleted2.Text = "Thème supprimé !"; //On réactualise la combobox pour enlever l'élément créé à la liste cbxSelectTh.Items.Clear(); cbxSelectTh.ResetText(); foreach (Theme unTheme in Theme.listeThemes()) { cbxSelectTh.Items.Add(unTheme.IdTheme + " (" + unTheme.NomTheme + ")"); } //On réactualise le DataGridView pour le remplir automatiquement remplirListeThemes(); } catch (Exception ex) { MessageBox.Show("ERREUR! Plus d'informations ci-dessous :"); MessageBox.Show("Message d'erreur : " + ex.Message); } }
/*根据订单编号 获取退货信息*/ public TH GetTHByOrderNum(long OrderNum) { TH finfo = new TH(); finfo = (from p in context.TH where p.TH_OrderNum.Equals(OrderNum) select p).FirstOrDefault(); return(finfo); }
public static void Show(Business2 parent, TIPSTYLE tIPSTYLE, string txt) { TH.addOnceUI(new Action(() => { if (sst == null) { sst = new ShowSubTip(); } if (tIPSTYLE == TIPSTYLE.MachineError) { sst.tipStyle.Source = MachineError; } else if (tIPSTYLE == TIPSTYLE.NoCar) { sst.tipStyle.Source = NoCar; } else { sst.tipStyle.Source = PutCarOutFailed; } sst.error.Text = txt; if (tIPSTYLE != TIPSTYLE.MachineError) { parent.showBackExit(); CD.countDownTime.stop(); } parent.setBusinessValue(sst); })); }
private void checkAnimation() { while (Visibility == Visibility.Visible && stop == false) { for (int i = 0; i < 6 && Visibility == Visibility.Visible && stop == false; i++) { Thread.Sleep(500); antip.Append(". "); TH.addOnceUI(new Action(() => { tip.Text = antip.ToString(); })); } } if (stop) { TH.addOnceUI(new Action(() => { tip.Text = tipTxt; foreach (Label l in p) { l.Content = ""; } ps.Clear(); index = 0; })); } antip.Clear(); canBeChange = true; }
/*更改退货单状态*/ public void UpdateTHStatus(long id, int THStatus) { TH th = (from a in context.TH where a.TH_OrderNum == id select a).FirstOrDefault <TH>(); th.TH_Status = THStatus; context.SaveChanges(); }
private void stopMessageSpam() { try { Attacks_Stats.Spam = false; Workerthread.Abort(); //for (int i =0; i != Working_Threads.Count() -1; i++) //{ // try // { // Thread TH = Working_Threads.ElementAt(i); // } // catch { } //} foreach (Thread TH in Working_Threads) { try { TH.Abort(); } catch { } } Working_Threads.Clear(); if (Attacks_Stats.CFMad) { MessageBox.Show("Cloudflare limited :(", "Alert"); } } catch (Exception e) { Console.WriteLine(e.Message); } }
//private void Border_PreviewMouseDown(object sender, MouseButtonEventArgs e) //{ // if (nextStep != null) // nextStep(); // Hide(); //} public static void show(bool isSuccess, Action nextStep_, string txt) { nextStep = nextStep_; TH.addOnceUI(new Action(() => { if (success == null) { success = new BitmapImage(new Uri(@"../Soruce/Inages_ZQ/成功.png", UriKind.Relative)); failed = new BitmapImage(new Uri(@"../Soruce/Images/失败.png", UriKind.Relative)); } if (st == null) { st = new ShowTip(); } if (isSuccess) { st.ico.Source = success; } else { st.ico.Source = failed; } st.tip.Text = txt; st.Show(); })); }
private void txtLTtime_TextChanged(object sender, EventArgs e) { int TC, LT, TH; try { TC = int.Parse(txtCoursePoint.Text); } catch { TC = 0; } try { LT = int.Parse(txtLTtime.Text); } catch { LT = TC * 15; } if (LT <= (TC * 15)) { TH = TC * 15 - LT; } else { TH = 0; } txtTHtime.Text = TH.ToString(); }
public ActionResult Step4(long Id) { TH th = ServiceHelper.Create <ITHService>().GetTHById(Id); ViewBag.OrderNo = th.TH_OrderNum; if (th != null) { ViewBag.TK = th.TH_Time.ToString("yyyy-MM-dd hh:mm:ss"); List <TKMessageModel> tkmms = new List <TKMessageModel>(); List <TKMessage> tks = ServiceHelper.Create <ITKService>().getTKMessage(th.Id); foreach (TKMessage item in tks) { TKMessageModel tkmm = new TKMessageModel() { MessageAttitude = item.MessageAttitude, ReturnName = item.ReturnName, MessageDate = item.MessageDate, MessageContent = item.MessageContent, UserId = item.UserId, TKId = item.TKId, Id = item.Id, tkis = ServiceHelper.Create <ITKService>().getTKImage(item.Id) }; tkmms.Add(tkmm); } ViewBag.tkmms = tkmms; } return(View()); }
/*退货 寄货*/ public void SendTH(long id, string wldh, string wlgs) { TH th = (from a in context.TH where a.TH_OrderNum == id select a).FirstOrDefault <TH>(); th.TH_Status = 4; th.TH_WLGS = wlgs; th.TH_WLDH = wldh; context.SaveChanges(); }
public TH GetTHById(long id) { TH finfo = new TH(); finfo = ( from p in context.TH where p.Id.Equals(id) select p).FirstOrDefault(); return(finfo); }
private void TXButton_Click(object sender, RoutedEventArgs e) { if (canBeChange == false) { return; } TXButton tx = sender as TXButton; if (tx.Content != null) { string txt = tx.Content as string; if (txt.Length == 1) { if (index >= p.Length) { return; } if (tip.Text != "") { tip.Text = ""; } ps.Add(txt); p[index].Content = "●"; index++; if (index >= p.Length) { canBeChange = false; TH.addOnceData(checkPsw); } } else { foreach (Label l in p) { l.Content = ""; } ps.Clear(); index = 0; Hide(); } } else { if (index == 0) { return; } ps.RemoveAt(ps.Count - 1); index--; p[index].Content = ""; } }
///////////////////功能方法/////////////////////// public void returnToMain() { try { clearTopUI(); mainArea.Child = mainGrid; BackExit.setBack(returnToMain); } catch { TH.addOnceUI(returnToMain); } }
/*退货审核操作*/ public JsonResult InsertTH(long OrderNo, string Introduce, int Attitude) { Result res = new Result(); try { //订单信息 OrderInfo order = ServiceHelper.Create <IOrderService>().GetOrder(Convert.ToInt64(OrderNo)); //退款单信息 TH tkQ = ServiceHelper.Create <ITHService>().GetTHByOrderNum(OrderNo); //添加退款日志信息 THMessageInfo tkm = new THMessageInfo() { MessageContent = Introduce, MessageDate = DateTime.Now, MessageAttitude = Convert.ToInt32(Attitude), ReturnName = base.CurrentUser.RealName, UserId = base.CurrentUser.Id, THId = tkQ.Id }; long tkmid = ServiceHelper.Create <ITHService>().InsertTHMessage(tkm); if (Attitude == 1) { //同意退款 //1、更改退货单状态为 已同意 ServiceHelper.Create <ITHService>().UpdateTHStatus(OrderNo, 2); //更改订单状态为退货中,等待后台审核 转账 ServiceHelper.Create <IOrderService>().UpdateOrderStatu(OrderNo, 8); } else { //拒绝退款 //1、更改退货单状态为 拒绝退货 ServiceHelper.Create <ITHService>().UpdateTHStatus(OrderNo, 3); //更改订单状态为拒绝退货 ServiceHelper.Create <IOrderService>().UpdateOrderStatu(OrderNo, 13); } res.success = true; res.msg = "操作成功!"; } catch (Exception) { res.success = false; res.msg = "操作异常!"; } return(Json(res)); }
public static void ShowMachineError2() { TH.addOnceUI(new Action(() => { if (CD.business2 == null) { CD.business2 = new Business2(); } CD.countDownTime.stop(); CD.setMainUI(CD.business2); CD.business2.setTitle("异常"); CD.business2.hidenBackExit(); Show(CD.business2, TIPSTYLE.MachineError, "设备故障,请联系管理员处理"); })); }
public static void ShowMachineError1() { TH.addOnceUI(new Action(() => { if (CD.business1 == null) { return; } CD.setMainUI(CD.business1); CD.countDownTime.stop(); CD.business1.setTitle("异常"); CD.business1.hidenBackAndExitBtn(); Show(CD.business1, TIPSTYLE.MachineError, "设备故障,请联系管理员处理"); })); }
public TH GetTHInfo(string th) { if (string.IsNullOrWhiteSpace(th)) { return(null); } long newlong = long.Parse(th); TH finfo = new TH(); finfo = ( from p in context.TH where p.TH_Number.Equals(newlong) select p).FirstOrDefault(); return(finfo); }
public ActionResult Step2(long orderNo) { /*退货信息*/ TH th = ServiceHelper.Create <ITHService>().GetTHByOrderNum(orderNo); if (th == null) { decimal newmoney = 0; OrderInfo oinfo = ServiceHelper.Create <IOrderService>().GetOrder(orderNo); OrderItemInfo oiiinfo = ServiceHelper.Create <IOrderService>().GetOrderItemInfo(orderNo); if (oiiinfo != null || oinfo != null) { newmoney = oinfo.OrderTotalAmount - (oinfo.Freight + oinfo.Insurancefee + oinfo.Transactionfee + oinfo.Counterfee); } ViewBag.TH_Reason = ""; ViewBag.TH_ProductMoney = newmoney; ViewBag.TH_Status = 0; } else { ViewBag.TH_Reason = th.TH_Reason; ViewBag.TH_ProductMoney = th.TH_ProductMoney; ViewBag.TH_Status = th.TH_Status; } /*订单信息*/ OrderInfo order = ServiceHelper.Create <IOrderService>().GetOrder(Convert.ToInt64(orderNo)); if (order.UserId == base.CurrentUser.Id) { ViewBag.OrderNo = orderNo; ViewBag.ShopName = order.ShopName; ViewBag.yunfei = order.Freight; ViewBag.total = order.ProductTotalAmount; ViewBag.max = order.Freight + order.ProductTotalAmount; ViewBag.ShopId = order.ShopId; } else { ViewBag.OrderNo = ""; ViewBag.ShopName = ""; ViewBag.yunfei = ""; ViewBag.total = ""; ViewBag.max = ""; ViewBag.ShopId = ""; } return(View()); }
private void input(string val) { if (index >= p.Length) { return; } ps.Add(val); p[index].Content = "●"; index++; if (index >= p.Length) { canBeChange = false; TH.addOnceData(checkPsw); } }
private void handle() { string timeTag2 = timeTag; while (isStop == false && nowTime >= 0 && timeTag == timeTag2) { Dispatcher.Invoke(DispatcherPriority.Normal, new Action(updateUI)); nowTime--; Thread.Sleep(1000); } if (isStop == false && nowTime < 0 && timeTag == timeTag2) { if (whenExit != null) { TH.addOnceUI(whenExit); } TH.addOnceUI(BackExit.Exit); } }
public static void show(Action nextStep, string tip, bool isEnd) { TH.addOnceUI(new Action(() => { if (nsui == null) { nsui = new NetStepUI(); } nsui.t.Text = tip; nsui.nextStep = nextStep; if (isEnd) { nsui.ok.Content = "返回首页"; } else { nsui.ok.Content = "领取下一张"; } CD.business1.setBusinessValue(nsui); })); }
public static string DataTableToXmlString(DataTable dtData) { if (dtData == null || dtData.Columns.Count == 0) { return((string)null); } DataColumn[] primaryKey = dtData.PrimaryKey; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(“ <TABLE> ”); stringBuilder.Append(“ <TR> ”); foreach (DataColumn dataColumn in (InternalDataCollectionBase)dtData.Columns) { if (DataTableUtil.IsPrimaryKey(dataColumn.ColumnName, primaryKey)) { stringBuilder.Append(“ < TH IsPK = ’true’ ColType = '”).Append(Convert.ToString(dataColumn.DataType == typeof (object) ? (object) typeof (string) : (object) dataColumn.DataType)).Append(“‘>”).Append(dataColumn.ColumnName.Replace(“&”, “”)).Append(“</TH>”); else stringBuilder.Append(“<TH IsPK=’false’ ColType='”).Append(Convert.ToString(dataColumn.DataType == typeof(object) ? (object)typeof(string) : (object)dataColumn.DataType)).Append(“‘ > ”).Append(dataColumn.ColumnName.Replace(“ & ”, “”)).Append(“ </ TH> ”); } }
/// <summary> /// update method /// </summary> /// <param name="info">model</param> /// <returns></returns> public bool UpdateTH(TH info) { if (info == null) { return(false); } TH thinfo = context.TH.FirstOrDefault((TH m) => m.Id == info.Id); if (thinfo == null) { return(false); } int i = 0; thinfo.TH_Number = info.TH_Number; thinfo.TH_OrderNum = info.TH_OrderNum; thinfo.TH_Time = info.TH_Time; thinfo.TH_UserId = info.TH_UserId; thinfo.TH_UserName = info.TH_UserName; thinfo.TH_UserType = info.TH_UserType; thinfo.TH_ProductName = info.TH_ProductName; thinfo.TH_ProductCount = info.TH_ProductCount; thinfo.TH_ProductMoney = info.TH_ProductMoney; thinfo.TH_ProductMoneyReal = info.TH_ProductMoneyReal; thinfo.TH_ProductMoneyType = info.TH_ProductMoneyType; thinfo.TH_ToUserId = info.TH_ToUserId; thinfo.TH_ToUserName = info.TH_ToUserName; thinfo.TH_ToUserType = info.TH_ToUserType; thinfo.TH_Status = info.TH_Status; i = context.SaveChanges(); if (i > 0) { return(true); } else { return(false); } }
/// <summary> /// 拒绝退货 /// </summary> /// <param name="thnum"></param> /// <returns></returns> public JsonResult THJJ(string thnum) { if (string.IsNullOrWhiteSpace(thnum)) { return(Json("no")); } TH th = ServiceHelper.Create <ITHService>().GetTHInfo(thnum); if (th == null) { return(Json("no")); } th.TH_Status = 7; if (ServiceHelper.Create <ITHService>().UpdateTH(th)) { return(Json("yes")); } else { return(Json("no")); } }
private void btnModifierTh_Click(object sender, EventArgs e) { try { int i = cbxSelectTh.SelectedIndex; Theme TH; TH = Theme.listeThemes().ElementAt(i); TH.modifierTheme(cbxSelectTh.SelectedIndex, txbNomTh2.Text, cbxSelectAt3.SelectedIndex); cbxSelectTh.ResetText(); txbNomTh2.Clear(); cbxSelectAt3.ResetText(); lblModified2.Text = "Thème modifié !"; //On réactualise le DataGridView pour le remplir automatiquement remplirListeThemes(); } catch (Exception ex) { MessageBox.Show("ERREUR! Plus d'informations ci-dessous :"); MessageBox.Show("Message d'erreur : " + ex.Message); } }
public SettingsEventArgs(TH m_v) => m_value = m_v;
/*审核退货单*/ public JsonResult CheckTH(long id) { Result res = new Result(); try { /*1、转账*/ TH tk = ServiceHelper.Create <ITHService>().GetTHByOrderNum(id); if (tk != null) { long buyid = tk.TH_UserId; long sellid = tk.TH_ToUserId; decimal tkamount = tk.TH_ProductMoney; /* 获取转账方的用户id和用户类型 供应商2*/ Finance_Wallet fwinfo = ServiceHelper.Create <IFinance_WalletService>().GetWalletInfo(sellid, 2, int.Parse(ConfigurationManager.AppSettings["CoinType"].ToString())); fwinfo.Wallet_UserLeftMoney = fwinfo.Wallet_UserLeftMoney - tkamount;//获取当前用的可用金额 /* 获取转账接受方的用户id和用户类型 采购商3*/ Finance_Wallet fwinfoto = ServiceHelper.Create <IFinance_WalletService>().GetWalletInfo(buyid, 3, int.Parse(ConfigurationManager.AppSettings["CoinType"].ToString())); fwinfoto.Wallet_UserLeftMoney = fwinfoto.Wallet_UserLeftMoney + tkamount;//获取当前用的可用金额 /*添加财务转账信息*/ Finance_Transfer ftinfo = new Finance_Transfer(); ChemCloud.Service.Order.Business.OrderBO _orderBO = new ChemCloud.Service.Order.Business.OrderBO(); ftinfo.Trans_Number = _orderBO.GenerateOrderNumber();/*创建转账单号*/ ftinfo.Trans_UserId = sellid; ftinfo.Trans_UserType = 2; ftinfo.Trans_Money = tkamount; ftinfo.Trans_SXMoney = 0; ftinfo.Trans_MoneyType = int.Parse(ConfigurationManager.AppSettings["CoinType"].ToString()); ftinfo.Trans_Time = DateTime.Now; ftinfo.Trans_Address = ChemCloud.Core.Common.GetIpAddress(); ftinfo.Trans_ToUserId = buyid; ftinfo.Trans_ToUserType = 3; ftinfo.Trans_Status = 1; ServiceHelper.Create <IFinance_TransferService>().AddFinance_Transfer(ftinfo); ServiceHelper.Create <IFinance_WalletService>().UpdateFinance_Wallet(fwinfo); ServiceHelper.Create <IFinance_WalletService>().UpdateFinance_Wallet(fwinfoto); //添加财务退款信息 Finance_Refund frinfo = new Finance_Refund(); frinfo.Refund_Number = _orderBO.GenerateOrderNumber();//创建退款单号 frinfo.Refund_OrderNum = id; frinfo.Refund_UserId = sellid; frinfo.Refund_UserType = 2; frinfo.Refund_UserName = ServiceHelper.Create <IMemberService>().GetMember(sellid).UserName == null ? "" : ServiceHelper.Create <IMemberService>().GetMember(sellid).UserName; frinfo.Refund_Money = tkamount; frinfo.Refund_MoneyType = int.Parse(ConfigurationManager.AppSettings["CoinType"].ToString()); frinfo.Refund_SXMoney = 0; frinfo.Refund_ISChujing = 0; frinfo.Refund_Address = ChemCloud.Core.Common.GetIpAddress(); frinfo.Refund_Time = tk.TH_Time; frinfo.Refund_Status = 1; frinfo.Refund_ToUserId = buyid; frinfo.Refund_ToUserType = 3; frinfo.Refund_ToUserName = ServiceHelper.Create <IMemberService>().GetMember(buyid).UserName == null ? "" : ServiceHelper.Create <IMemberService>().GetMember(buyid).UserName; ServiceHelper.Create <IFinance_RefundService>().AddFinance_Refund(frinfo); /*2、更改退货单的状态 为已完成*/ ServiceHelper.Create <ITHService>().UpdateTHStatus(id, 6); /*3更改订单的状态 单状态为已退货*/ ServiceHelper.Create <IOrderService>().UpdateOrderStatu(id, 9); res.success = true; } else { res.success = false; } } catch (Exception) { res.success = false; } return(Json(res)); }
/// <summary> /// 同意退货 /// </summary> /// <param name="thnum">退货单号</param> /// <param name="orderid">订单号</param> /// <returns></returns> public JsonResult THTY(string thnum, string orderid) { if (string.IsNullOrWhiteSpace(thnum)) { return(Json("no")); } TH th = ServiceHelper.Create <ITHService>().GetTHInfo(thnum); if (th == null) { return(Json("no")); } th.TH_Status = 6; if (ServiceHelper.Create <ITHService>().UpdateTH(th)) { Finance_Wallet fwinfo = ServiceHelper.Create <IFinance_WalletService>().GetWalletInfo(base.CurrentUser.Id, base.CurrentUser.UserType, int.Parse(ConfigurationManager.AppSettings["CoinType"])); if (fwinfo == null) { return(Json("no")); } //更新供应商的锁定金额 减去退款金额 fwinfo.Wallet_UserMoneyLock = fwinfo.Wallet_UserMoneyLock - th.TH_ProductMoneyReal; if (ServiceHelper.Create <IFinance_WalletService>().UpdateFinance_Wallet(fwinfo)) { #region 添加退款信息 OrderInfo oinfo = ServiceHelper.Create <IOrderService>().GetOrder(long.Parse(orderid)); Finance_Refund frinfo = new Finance_Refund(); ChemCloud.Service.Order.Business.OrderBO _orderBO = new ChemCloud.Service.Order.Business.OrderBO(); long frid = _orderBO.GenerateOrderNumber(); frinfo.Refund_Number = frid; frinfo.Refund_OrderNum = long.Parse(thnum); frinfo.Refund_UserId = base.CurrentUser.Id; frinfo.Refund_UserType = base.CurrentUser.UserType; frinfo.Refund_UserName = base.CurrentUser.UserName; frinfo.Refund_ToUserId = oinfo.UserId; frinfo.Refund_ToUserType = 3; frinfo.Refund_ToUserName = oinfo.UserName; frinfo.Refund_Money = th.TH_ProductMoneyReal; frinfo.Refund_MoneyType = th.TH_ProductMoneyType; frinfo.Refund_SXMoney = 0; frinfo.Refund_ISChujing = 0; frinfo.Refund_Address = ChemCloud.Core.Common.GetIpAddress(); frinfo.Refund_Time = DateTime.Now; frinfo.Refund_Status = 1; if (ServiceHelper.Create <IFinance_RefundService>().AddFinance_Refund(frinfo)) { //更新采购商的可用余额 返还退款金额 Finance_Wallet fwuinfo = ServiceHelper.Create <IFinance_WalletService>().GetWalletInfo(oinfo.UserId, 3, int.Parse(oinfo.CoinType.ToString())); fwuinfo.Wallet_UserLeftMoney = fwuinfo.Wallet_UserLeftMoney + th.TH_ProductMoneyReal; if (ServiceHelper.Create <IFinance_WalletService>().UpdateFinance_Wallet(fwuinfo)) { //更新订单状态 已退货 ServiceHelper.Create <IOrderService>().UpdateOrderStatu(long.Parse(orderid), 9); return(Json("yes")); } else { return(Json("no")); } } else { return(Json("no")); } #endregion } else { return(Json("no")); } } else { return(Json("no")); } }