public ActionResult Save(StatusTable statuss) { bool status = false; if (ModelState.IsValid) { using (MainDBEntities mainDB = new MainDBEntities()) { if (statuss.StatusID > 0) { //edycja var s = mainDB.StatusTables.Where(a => a.StatusID == statuss.StatusID).FirstOrDefault(); if (s != null) { s.StatusName = statuss.StatusName; } } else { //zapis mainDB.StatusTables.Add(statuss); } mainDB.SaveChanges(); status = true; } } return(new JsonResult { Data = new { status = status } }); }
public FeatureEntry(string id, string status_id, string name_enu, string status_enu, string comments_enu, string name_fra, string status_fra, string comments_fra) { int.TryParse(id, out int IdInt); Id = IdInt; int.TryParse(status_id, out int StatusInt); StatusId = StatusInt; string EnglishName = Language.ReplaceHtml(name_enu); NameTable.Add(LanguageStates.English, EnglishName); string EnglishStatus = Language.ReplaceHtml(status_enu); StatusTable.Add(LanguageStates.English, EnglishStatus); string EnglishComments = Language.ReplaceHtml(comments_enu); CommentsTable.Add(LanguageStates.English, EnglishComments); string FrenchName = Language.ReplaceHtml(name_fra); NameTable.Add(LanguageStates.French, FrenchName); string FrenchStatus = Language.ReplaceHtml(status_fra); StatusTable.Add(LanguageStates.French, FrenchStatus); string FrenchComments = Language.ReplaceHtml(comments_fra); CommentsTable.Add(LanguageStates.French, FrenchComments); }
/// <summary> /// 订单发货 /// </summary> /// <param name="SessionKey">SessionKey</param> /// <param name="OutNumber">订单编号</param> /// <param name="CompanyCode">物流编码</param> /// <param name="DeliveryNumber">发货单号</param> /// <returns></returns> internal StatusTable ToDelivery(string SessionKey, string OutNumber, string CompanyCode, string DeliveryNumber) { StatusTable st = new StatusTable() { Msg = "" }; if (!String.IsNullOrEmpty(CompanyCode)) { ITopClient client = new DefaultTopClient(StaticSystemConfig.soft.ApiURL, StaticSystemConfig.soft.AppKey, StaticSystemConfig.soft.AppSecret, "json"); LogisticsOfflineSendRequest req = new LogisticsOfflineSendRequest(); req.Tid = long.Parse(OutNumber); req.OutSid = DeliveryNumber; req.CompanyCode = CompanyCode; LogisticsOfflineSendResponse response = client.Execute(req, SessionKey); if (response.Shipping == null) { st.Msg = "解析淘宝发货数据失败,可能该订单状态不允许发货"; } else { st.IsSuccess = response.Shipping.IsSuccess; if (!st.IsSuccess) { st.Msg = "淘宝发货失败"; } } } else { st.IsSuccess = false; st.Msg = "解析淘宝物流公司编码失败"; } return(st); }
public override void Read(byte[] array) { _ = McInt.TryParse(ref array, out EntityID); if (McByte.TryParse(ref array, out var entityStatus)) { EntityStatus = (StatusTable)entityStatus; } }
public CS3TablesGroup() { tablesDirectory = ConfigurationManager.AppSettings["CS3TablesLocation"] + Path.DirectorySeparatorChar; Name = new NameTable(tablesDirectory); Status = new StatusTable(tablesDirectory, Name); //var nameR = Name.GetRecords().Where(i => i.OwnerID >= 0).OrderBy(i => i.OwnerID).ToList(); //var statusR = Status.GetStatusPRecords().ToList(); Magic = new MagicTable(tablesDirectory, Name); }
private void btnJoin_Click(object sender, EventArgs e) { try { frmChooseeTableJoin frm = new frmChooseeTableJoin(); string lineOldTableNo = string.Empty; if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (frm.TableNo < 40) { TableNew = frm.TableNo + ""; foreach (Control ctr in flpJoinTable.Controls) { UCTable ucTableJoin = (UCTable)ctr; if (ucTableJoin.BackColor == Color.FromArgb(0, 204, 15)) { StatusTable st = (StatusTable)ucTableJoin.Tag; OrderJoinTableModel JoinTable = new OrderJoinTableModel(); JoinTable.OrderID = st.OrderID; JoinTable.TableID = Convert.ToInt32(st.TableID); JoinTable.SubTotalTable = Convert.ToDouble(st.SubTotal); JoinTable.TableIDNew = frm.TableNo; JoinTable.OrderNumber = st.OrderNum; lstJoinTable.Add(JoinTable); } } if (lstJoinTable.Count > 0) { int result = OrderService.JoinTable(lstJoinTable); if (result == 1) { GetListPrinter(); foreach (PrinterModel item in PrintData) { Header = item.Header; posPrinter.SetPrinterName(item.PrinterName); posPrinter.printDocument.PrintPage += printDocument_PrintPage; posPrinter.Print(); } this.Close(); this.DialogResult = System.Windows.Forms.DialogResult.OK; } } } else { frmMessager frmmes = new frmMessager("Join Table", "TableNo is unavailable"); frmOpacity.ShowDialog(this, frmmes); } } } catch (Exception ex) { LogPOS.WriteLog("frmJoinTable:::::::::::::::::btnJoin_Click::::::::::::::::;;" + ex.Message); } }
public ActionResult Bedom(StatusTable nyStatus) { ServiceReference2.Service1Client klient = new ServiceReference2.Service1Client(); StatusClass nyB = new StatusClass(); nyB.Bfyrasiffror = nyStatus.Bfyrasiffror; nyB.Bedomning = nyStatus.Bedomning; nyB.Datum = nyStatus.Datum; nyB.Kommentar = nyStatus.Kommentar; klient.CreateStatus(nyStatus); return(RedirectToAction("Ansokningar", "Admin")); }
/// <summary> /// Status table as a dictionary with Key = Status & Value = Description /// </summary> /// <returns></returns> public IDictionary <string, string> GetStatusDictionary() { //var rows = StatusTable[0].FindElements(By.TagName("tr")); //Dictionary<string, string> statusAndDescription = new Dictionary<string, string>(); //for (int i = 1; i < rows.Count; i++) //{ // var columns = rows[i].FindElements(By.TagName("td")); // statusAndDescription.Add(columns[0].Text, columns[1].Text); //} //return statusAndDescription; return(StatusTable.ToDictionary(element => element.FindElements(By.TagName("td"))[0].Text, element => element.FindElements(By.TagName("td"))[1].Text)); }
/// <summary> /// 查询第三方平台订单物流信息 /// </summary> /// <param name="SessionKey">SessionKey</param> /// <param name="OutNumber">外部订单号</param> /// <returns></returns> internal StatusTable SelectDelivery(string SessionKey, string TradeId) { StatusTable st = new StatusTable() { Msg = "" }; try { ITopClient client = new DefaultTopClient(StaticSystemConfig.soft.ApiURL, StaticSystemConfig.soft.AppKey, StaticSystemConfig.soft.AppSecret, "json"); LogisticsOrdersGetRequest req = new LogisticsOrdersGetRequest(); req.Fields = "out_sid,company_name"; if (string.IsNullOrEmpty(TradeId)) { return(null); } else { req.Tid = long.Parse(TradeId); } LogisticsOrdersGetResponse response = client.Execute(req, SessionKey); if (!response.IsError) { if (response.Shippings.Count > 0) { st.IsSuccess = true; string str = ""; foreach (Top.Api.Domain.Shipping ship in response.Shippings) { str = ship.CompanyName + " <font color='red'>" + ship.OutSid + "</font>"; } st.Msg = "订单已发货,发货信息[" + str + "]"; } else { st.IsSuccess = false; st.Msg = "未查询到该订单的物流信息"; } } } catch { st.IsSuccess = false; st.IsError = true; st.Msg = "查询该订单物流信息失败"; } return(st); }
private void timer1_Tick(object sender, EventArgs e) { try { for (int i = 0; i < flowLayoutPanel1.Controls.Count; i++) { UCTable ucTable = (UCTable)flowLayoutPanel1.Controls[i]; if (ucTable.Tag != null) { StatusTable st = (StatusTable)ucTable.Tag; ucTable.lbTime.Text = GetLongTime(st.Time); } } } catch (Exception ex) { LogPOS.WriteLog("timer1_Tick:::::::::::::::::::::::::::::::::::::::::" + ex.Message); } }
private void CheckStatusTableRealTime() { try { for (int i = 0; i < flowLayoutPanel1.Controls.Count; i++) { UCTable ucTable = (UCTable)flowLayoutPanel1.Controls[i]; if (ucTable.BackColor != Color.Green && ucTable.BackColor != Color.FromArgb(0, 102, 204)) { StatusTable statusTable = OrderService.GetStatusTable(ucTable.lbTableNo.Text); if (statusTable.Complete == 0) { ucTable.BackColor = Color.Green; ucTable.ForeColor = Color.White; ucTable.lbTime.Text = statusTable.Time; ucTable.Tag = statusTable; SetText("$" + monetFormat.Format(Convert.ToDouble(statusTable.SubTotal)), ucTable.lbSubTotal); } if (statusTable.Complete == 2) { ucTable.BackColor = Color.FromArgb(0, 102, 204); ucTable.ForeColor = Color.White; ucTable.lbTime.Text = statusTable.Time; ucTable.Tag = statusTable; SetText("$" + monetFormat.Format(Convert.ToDouble(statusTable.SubTotal)), ucTable.lbSubTotal); ucTable.Refresh(); } if (statusTable.Complete == -1) { ucTable.BackColor = Color.FromArgb(242, 242, 242); ucTable.ForeColor = Color.Black; ucTable.Tag = null; SetText("", ucTable.lbTime); SetText("", ucTable.lbSubTotal); } } } } catch (Exception ex) { LogPOS.WriteLog("CheckStatusTable::::::::::::::::::::::::::::" + ex.Message); } }
/// <summary> /// EntityBehavior回收进对象池时被调用 /// </summary> /// <returns></returns> public EntityBehavior Downcast() { for (int index = 1; index < (int)AOTTransIndex.count; index++) { TransTable.Set(index, 0); } TransTable.Recycle(); TransTable = null; for (int index = 1; index < (int)AOIStatusIndex.count; index++) { StatusTable.Set(index, 0); } StatusTable.Recycle(); StatusTable = null; for (int index = 1; index < (int)CompIndex.Count; index++) { CompTable.Set(index, 0); } CompTable.Recycle(); CompTable = null; RemoveAllEntityComp(); if (body != null) { ResourceManager.RecyclePrefab(body); body = null; } gameObject.name = RecycleName; OnBodyCreate = null; SceneId = 0; EntityType = 0; AoiId = 0; destroyed = false; bodyLoading = false; logicSpeed = 1f; body = null; transform.position = OnRecylePos; transform.localScale = Vector3.one; return(this); }
/// <summary> /// Handles the specified command. /// </summary> /// <param name="commandSend">The command.</param> /// <returns></returns> public int Handle(SendMessageCommand commandSend) { if (!_databaseExists.Exists()) { return(0); } if (!_messageExpirationEnabled.HasValue) { _messageExpirationEnabled = _options.Value.EnableMessageExpiration; } TimeSpan?expiration = null; if (_messageExpirationEnabled.Value) { expiration = MessageExpiration.GetExpiration(commandSend, data => data.GetExpiration()); } var jobName = _jobSchedulerMetaData.GetJobName(commandSend.MessageData); var scheduledTime = DateTimeOffset.MinValue; var eventTime = DateTimeOffset.MinValue; if (!string.IsNullOrWhiteSpace(jobName)) { scheduledTime = _jobSchedulerMetaData.GetScheduledTime(commandSend.MessageData); eventTime = _jobSchedulerMetaData.GetEventTime(commandSend.MessageData); } var id = 0; using (var db = _connectionInformation.GetDatabase()) { lock (Locker) //we need to block due to jobs { try { db.Database.BeginTrans(); //only blocks on shared connections if (string.IsNullOrWhiteSpace(jobName) || _jobExistsHandler.Handle( new DoesJobExistQuery(jobName, scheduledTime, db.Database)) == QueueStatuses.NotQueued) { var serialization = _serializer.Serializer.MessageToBytes( new MessageBody { Body = commandSend.MessageToSend.Body }, commandSend.MessageToSend.Headers); //create queue var queueData = new QueueTable() { Body = serialization.Output }; commandSend.MessageToSend.SetHeader(_headers.StandardHeaders.MessageInterceptorGraph, serialization.Graph); queueData.Headers = _serializer.InternalSerializer.ConvertToBytes(commandSend.MessageToSend.Headers); var col = db.Database.GetCollection <QueueTable>(_tableNameHelper.QueueName); id = col.Insert(queueData).AsInt32; //create metadata var metaData = new MetaDataTable { QueueId = id, CorrelationId = (Guid)commandSend.MessageData.CorrelationId.Id.Value, QueuedDateTime = DateTime.UtcNow }; if (!string.IsNullOrWhiteSpace(jobName)) { metaData.QueueProcessTime = scheduledTime.UtcDateTime; } else if (_options.Value.EnableDelayedProcessing) { var delay = commandSend.MessageData.GetDelay(); if (delay.HasValue) { metaData.QueueProcessTime = DateTime.UtcNow.Add(delay.Value); } } if (_options.Value.EnableMessageExpiration && expiration.HasValue) { metaData.ExpirationTime = DateTime.UtcNow.Add(expiration.Value); } if (_options.Value.EnableStatus) { metaData.Status = QueueStatuses.Waiting; } if (_options.Value.EnableRoute && !string.IsNullOrWhiteSpace(commandSend.MessageData.Route)) { metaData.Route = commandSend.MessageData.Route; } var colMeta = db.Database.GetCollection <MetaDataTable>(_tableNameHelper.MetaDataName); colMeta.Insert(metaData); //create status table record if (_options.Value.EnableStatusTable || !string.IsNullOrWhiteSpace(jobName)) { var statusData = new StatusTable() { Status = metaData.Status, CorrelationId = metaData.CorrelationId, QueueId = id }; if (!string.IsNullOrWhiteSpace(jobName)) { statusData.JobName = jobName; } var colStatus = db.Database.GetCollection <StatusTable>(_tableNameHelper.StatusName); colStatus.Insert(statusData); } //job name if (!string.IsNullOrWhiteSpace(jobName)) { _sendJobStatus.Handle(new SetJobLastKnownEventCommand(jobName, eventTime, scheduledTime, db.Database)); } } else { throw new DotNetWorkQueueException( "Failed to insert record - the job has already been queued or processed"); } db.Database.Commit(); } catch { db.Database.Rollback(); throw; } } return(id); } }