public ActionResult Copy(int id, int? mediaSetId, int? mediaGroupId, string name, string description, string price) { try { var media = Context.Media.Single(s => s.MediaId == id); var set = mediaSetId.HasValue ? Context.MediaSets.Single(a => a.MediaSetId == mediaSetId) : media.MediaSet; var group = mediaGroupId.HasValue ? Context.MediaGroups.Single(a => a.MediaGroupId == mediaGroupId) : media.MediaGroup; var copy = media.Copy(); if (name != null && description != null && price != null) { media.PropertyWithName("Naam").Value = name; media.PropertyWithName("Prijs").Value = price; media.PropertyWithName("Omschrijving").Value = description; } if (mediaSetId.HasValue) set.Media.Add(copy); if (mediaGroupId.HasValue) group.Media.Add(copy); Context.SaveChanges(); TempData["message"] = new InfoMessage("Foto is gekopiëerd naar " + set.Name + ".", InfoMessage.InfoType.Notice); } catch (Exception e) { Elmah.ErrorSignal.FromCurrentContext().Raise(e); TempData["message"] = new InfoMessage("Er is een fout opgetreden bij het kopieëren van de set.", InfoMessage.InfoType.Error); } return Redirect(Request.UrlReferrer.ToString()); }
public InfoNetworkMessage(byte messageId, InfoMessage msg) { base.Id = messageId; base.TypeVal = (byte)NetworkEventType.Info; base.SpecificTypeVal = (byte)msg; base.Data = null; }
void LogIn(NetworkMessage netMsg, InfoMessage msg) { bool loggedIn = false; string query = "SELECT * FROM shogi.players WHERE players_email = \"" + msg.email + "\""; if (con.State.ToString () != "Open") con.Open (); using (con) { using (cmd = new MySqlCommand (query, con)) { rdr = cmd.ExecuteReader(); if (rdr.HasRows) { rdr.Read (); if (msg.password == rdr["players_password"].ToString ()) { incomeMessages.text += netMsg.conn.address + " logged in as " + msg.email + "\n"; loggedIn = true; } else incomeMessages.text += netMsg.conn.address + " failed logging in for wrong password " + msg.password + "\n"; } else incomeMessages.text += netMsg.conn.address + " failed logging in for no entry " + msg.email + "\n"; rdr.Dispose (); } string queryIP = "UPDATE shogi.players SET players_ip = \"" + netMsg.conn.address + "\" WHERE players_email = \"" + msg.email + "\""; if (loggedIn) { using (cmd = new MySqlCommand (queryIP, con)) cmd.ExecuteNonQuery (); msg.goal = "loggedin"; NetworkServer.SendToClient(netMsg.conn.connectionId, MyMsgType.Info, msg); } } }
public void ChangedAvatar(InfoMessage msg) { Texture2D avatarTex = new Texture2D (1, 1); avatarTex.LoadImage (msg.avatar); Sprite sprite = Sprite.Create (avatarTex, new Rect (0, 0, avatarTex.width, avatarTex.height), new Vector2 (0.5f, 0.5f)); avatar.sprite = sprite; CloseLoadingScreen (); }
public void SendInfo(int personID, Pose3D headPose) { InfoMessage msg = new InfoMessage(); msg.id = personID; msg.pose = headPose; NetworkServer.SendToAll(MyMsgType.Info, msg); }
public void ChangeAvatar(string filepath) { byte[] bytes = System.IO.File.ReadAllBytes (filepath); InfoMessage msg = new InfoMessage (); msg.avatar = bytes; msg.goal = "changeavatar"; InitLoadingScreen (); myClient.Send (MyMsgType.Info, msg); }
public void LogIn() { System.Security.Cryptography.SHA512Managed sha = new System.Security.Cryptography.SHA512Managed (); string pass = GetString (sha.ComputeHash (GetBytes (password.text))); InfoMessage msg = new InfoMessage (); msg.goal = "login"; msg.email = email.text; msg.password = pass; myClient.Send (MyMsgType.Info, msg); }
private void AddInfoMessage(string msg, bool isError) { string msgWithDate = DateTime.Now + " - " + msg; InfoMessage infoMsg = new InfoMessage(msgWithDate, isError); InfoMessages.Add(infoMsg); if (InfoMessages.Count >= _maxCountList) { InfoMessages.RemoveAt(0); } }
public void Format_MessageIsInfo_MessageContainsExplanatoryMessage() { var timeService = new FakeTimeService(); var current = new DateTime(2012, 08, 28, 12, 0, 0); timeService.CurrentDateTime = current; var message = new InfoMessage("User Arthur Dent just logged into his account"); var formatter = new LogFormater(timeService); var formattedMessage = formatter.Format(message); Assert.IsTrue(formattedMessage.StartsWith("[28.08.2012 12:00][Info] User Arthur Dent just logged into his account")); }
public void Format_MessageIsNotNull_CurrentDateIsFirstThingInMessage() { var timeService = new FakeTimeService(); var current = new DateTime(2012, 08, 28, 12, 0, 0); timeService.CurrentDateTime = current; var message = new InfoMessage("infomessage"); var formatter = new LogFormater(timeService); var formattedMessage = formatter.Format(message); Assert.IsTrue(formattedMessage.StartsWith("[28.08.2012 12:00]")); }
public ActionResult Delete(int id) { try { var set = Context.MediaSets.Single(s => s.MediaSetId == id); Context.DeleteObject(set); Context.SaveChanges(); TempData["message"] = new InfoMessage("Set is verwijderd.", InfoMessage.InfoType.Notice); } catch (Exception e) { Elmah.ErrorSignal.FromCurrentContext().Raise(e); TempData["message"] = new InfoMessage("Er is een fout opgetreden bij het verwijderen van de set.", InfoMessage.InfoType.Error); } return RedirectToAction("Index"); }
public ActionResult Delete(int? id) { try { var media = Context.Media.Single(m => m.MediaId == id); Context.DeleteObject(media); Context.SaveChanges(); TempData["message"] = new InfoMessage("Foto is verwijderd.", InfoMessage.InfoType.Notice); } catch (Exception e) { Elmah.ErrorSignal.FromCurrentContext().Raise(e); TempData["message"] = new InfoMessage("Er is een fout opgetreden bij het verwijderen van de foto.", InfoMessage.InfoType.Error); } return Redirect(Request.UrlReferrer.ToString()); }
public ActionResult Edit(MediaSet newSet) { string[] includeProps = new string[] { "Name", "StartDate", "EndDate", "Message" }; MediaSet set = null; try { set = Context.MediaSets.Single(s => s.MediaSetId == newSet.MediaSetId); UpdateModel(set, includeProps); Context.SaveChanges(); TempData["message"] = new InfoMessage("Fotoset aangepast.", InfoMessage.InfoType.Notice); } catch (Exception e) { Elmah.ErrorSignal.FromCurrentContext().Raise(e); TempData["message"] = new InfoMessage("Fout bij het bewerken van fotoset.", InfoMessage.InfoType.Error); } return RedirectToAction("Edit", new { id = set.MediaSetId }); }
public ActionResult New(int mediaSetId) { try { var group = new MediaGroup() { MediaSetId = mediaSetId }; Context.MediaGroups.AddObject(group); //group.PropertyWithName("Naam").Value = "Nieuwe groep"; Context.SaveChanges(); TempData["message"] = new InfoMessage("Nieuwe groep is aangemaakt.", InfoMessage.InfoType.Notice); } catch (Exception e) { Elmah.ErrorSignal.FromCurrentContext().Raise(e); TempData["message"] = new InfoMessage("Er is een fout opgetreden bij het maken van de group.", InfoMessage.InfoType.Error); } return Redirect(Request.UrlReferrer.ToString()); }
public ActionResult Copy(int id, int animationId, string name) { try { var set = Context.MediaSets.Single(s => s.MediaSetId == id); var animation = Context.Animations.Single(a => a.AnimationId == animationId); var copy = set.Copy(); if (!String.IsNullOrWhiteSpace(name)) { copy.Name = name; } animation.MediaSets.Add(copy); Context.SaveChanges(); } catch (Exception e) { Elmah.ErrorSignal.FromCurrentContext().Raise(e); TempData["message"] = new InfoMessage("Er is een fout opgetreden bij het kopieëren van de set.", InfoMessage.InfoType.Error); } return RedirectToAction("Index"); }
public ActionResult Edit(int id, string name, string description, string price) { MediaGroup group = null; try { group = Context.MediaGroups.Single(s => s.MediaGroupId == id); group.PropertyWithName("Naam").Value = name; group.PropertyWithName("Omschrijving").Value = description; group.PropertyWithName("Prijs").Value = price; Context.SaveChanges(); TempData["message"] = new InfoMessage("Groep aangepast.", InfoMessage.InfoType.Notice); } catch (Exception e) { Elmah.ErrorSignal.FromCurrentContext().Raise(e); TempData["message"] = new InfoMessage("Fout bij het bewerken van groep.", InfoMessage.InfoType.Error); } return View(group); }
public ActionResult Delete(int id) { try { var group = Context.MediaGroups.Single(s => s.MediaGroupId == id); // Work around ref. constraint problem for (int i = 0; i < group.Properties.Count; i++) Context.DeleteObject(group.Properties.ElementAt(i)); for (int i = 0; i < group.Media.Count; i++) Context.DeleteObject(group.Media.ElementAt(i)); Context.DeleteObject(group); Context.SaveChanges(); TempData["message"] = new InfoMessage("Groep is verwijderd.", InfoMessage.InfoType.Notice); } catch (Exception e) { Elmah.ErrorSignal.FromCurrentContext().Raise(e); TempData["message"] = new InfoMessage("Er is een fout opgetreden bij het verwijderen van de groep.", InfoMessage.InfoType.Error); } return Redirect(Request.UrlReferrer.ToString()); }
void GetMainMenu(NetworkMessage netMsg) { string query = "SELECT players_nickname, players_avatar FROM shogi.players WHERE players_ip = \"" + netMsg.conn.address + "\""; if (con.State.ToString () != "Open") con.Open (); using (con) { using (cmd = new MySqlCommand (query, con)) { rdr = cmd.ExecuteReader (); rdr.Read (); InfoMessage msg = new InfoMessage (); msg.nickname = rdr["players_nickname"].ToString (); string filepath = rdr["players_avatar"].ToString (); msg.avatar = File.ReadAllBytes(filepath); msg.goal = "menuinfo"; NetworkServer.SendToClient(netMsg.conn.connectionId, MyMsgType.Info, msg); } } }
protected override string HandleRequest(InfoMessage message) { return "ready"; }
public void Info(InfoMessage msg) { Log(msg); }
void GetMainMenu() { InfoMessage msg = new InfoMessage (); msg.goal = "getmenu"; InitLoadingScreen (); myClient.Send (MyMsgType.Info, msg); }
public void AddInfoMessages(Point StartPoint, InfoMessage.MessageType MessageType, double PercentPositionFromTop, string Message) { int num = this._infoMessages.Add(new InfoMessage(StartPoint, MessageType, PercentPositionFromTop, Message)); base.Controls.Add(this._infoMessages[num].Picture); }
void GoMainMenu(InfoMessage msg) { Debug.Log ("gone"); nickname.text = msg.nickname; Texture2D avatarTex = new Texture2D (1, 1); avatarTex.LoadImage (msg.avatar); Sprite sprite = Sprite.Create (avatarTex, new Rect (0, 0, avatarTex.width, avatarTex.height), new Vector2 (0.5f, 0.5f)); avatar.sprite = sprite; this.gameObject.SetActive (true); StartCoroutine (Fade (logInScreen)); StartCoroutine (Load (menuScreen)); CloseLoadingScreen (); }
/// <summary> /// Redirects response to the info page. /// </summary> /// <param name="infoMessage"> /// The info Message. /// </param> public static void RedirectInfoPage(InfoMessage infoMessage) { Redirect(ForumPages.info, "i={0}".FormatWith((int)infoMessage)); }
private void BTXuatfile_Click(object sender, EventArgs e) { //SaveFileDialog saveFileDialog = new SaveFileDialog(); //saveFileDialog.Filter = "PRCUPD.*|PRCUPD.*"; //saveFileDialog.FileName = "PRCUPD.001"; //if (saveFileDialog.ShowDialog() == DialogResult.OK) //{ try { if (gridView1.DataRowCount <= 0) { InfoMessage.HienThi("Không có dữ liệu export!!!!!", "Vui lòng kiểm tra lại", "Thông báo", HinhAnhThongBao.THONGTIN, NutThongBao.DONGY); return; } bool isdata = false; for (int i = 0; i < gridView1.DataRowCount; i++) { DataRow row = gridView1.GetDataRow(i); if (Convert.ToBoolean(row["Check"])) { isdata = true; } } if (!isdata) { InfoMessage.HienThi("vui lòng chọn dữ liệu export!!!!!", "Vui lòng kiểm tra lại", "Thông báo", HinhAnhThongBao.THONGTIN, NutThongBao.DONGY); return; } CTLSearchBug ctlSearchBug = new CTLSearchBug(); int iTo = 0; int maxP = GetMaxFilePRCUPD(); if (_filepuge < maxP) { _filepuge = maxP + 1; } if (_filepuge < 999) { _filepuge += 1; } //for (int i = 0; i < gridView1.DataRowCount;) //{ //int numTemp = gridView1.DataRowCount - i; //iTo = numTemp> 100 ? iTo + 100 : iTo + (numTemp); DirectoryInfo directoryInfo = new DirectoryInfo(Path.Combine(Path.Combine(Application.StartupPath, "ExportBackup"), DateTime.Now.ToString("yyyyMMddhhmm"))); if (!directoryInfo.Exists) { directoryInfo.Create(); } if (!ExportFile(@"H:\Pollfile")) { InfoMessage.HienThi("Conect server không thành công!!!!!", "Vui lòng kiểm tra lại", "Thông báo", HinhAnhThongBao.THONGTIN, NutThongBao.DONGY); return; } ExportFile(directoryInfo.FullName); //} // Ghi log file khi export ctlSearchBug.InsertTraceLog(Config._MaNV, DateTime.Now, GetIP(), "FrmSynPrice", 1, "FrontEnd Utility", "Export PRCUPD file"); InfoMessage.HienThi("Export file " + " thành công !!!!!", "Export file", "Thanh cong", HinhAnhThongBao.THANHCONG, NutThongBao.DONGY); return; } catch (Exception exception) { CTLError.WriteError("Export file from DSSKU ", exception.Message); //ctlSearchBug.InsertTraceLog(Config._MaNV, DateTime.Now, GetIP(), "FrmSynPrice", 0); return; throw; } //} }
private void InitViewPopups() { m_popupsDatabaseIsEmptyInfoMessage = new InfoMessage(InfoMessage.MessageType.Info, UILabels.DatabaseIsEmpty, false, Instance.Repaint); }
private void txtsoluong_KeyDown(object sender, KeyEventArgs e) { string upc = ""; string sku = ""; if (e.KeyCode == Keys.F5) { btclear_Click(null, null); return; } if (e.KeyCode == Keys.Enter) { if (gridView1.RowCount >= 30) { InfoMessage.HienThi("Số lượng SKU cho phép xuất bảng giá là 30 !", "Vui lòng kiểm tra lại", "Thong bao", HinhAnhThongBao.THONGTIN, NutThongBao.DONGY); return; } if (txtSKU.Text == string.Empty || txtSKU.Text.Length > 18) { return; } string where = ""; if (txtSKU.Text.Length <= 9) { sku = _sokhong.Substring(0, 9 - txtSKU.Text.Length) + txtSKU.Text; where = " and SKU='" + sku + "'"; } else { upc = _sokhong.Substring(0, 18 - txtSKU.Text.Length) + txtSKU.Text; where = " and UPC='" + upc + "'"; } if (!validate((sku != string.Empty) ? sku : upc)) { InfoMessage.HienThi("SKU đã có trong danh sách!", "Vui lòng thay đổi số lượng trong lưới", "Thong Bao", HinhAnhThongBao.THONGTIN, NutThongBao.DONGY); return; } TPSDataAccess dataAccess = new TPSDataAccess(_PathFileINVMST); TPSDataAccess dataAccessKM = new TPSDataAccess(_PathFileINVEVT); DataTable dt = new DataTable(); dt = dataAccess.GetTableDM("Select SKU,UPC,Description,Price From INVMST where 1=1 " + where); if (dt == null || dt.Rows.Count <= 0) { InfoMessage.HienThi("SKU không có trong danh mục!", "Vui lòng kiểm tra lại", "Thong Bao", HinhAnhThongBao.THONGTIN, NutThongBao.DONGY); return; } DataTable dtKM = new DataTable(); dtKM = dataAccessKM.GetTableDM("select SKU,QTY1,PRICE,DISCPRICE,Method,Prc_Key,Code From INVEVT where SKU='" + dt.Rows[0]["SKU"].ToString() + "' and " + (Math.Round(dateNgayapDung.Value.ToOADate()) + _Const_datetime) + @" >= Start and " + (Math.Round(dateNgayapDung.Value.ToOADate()) + _Const_datetime) + " <= stop and Method in (2,25)"); DataRow r = _dsSKU.NewRow(); r["SKU"] = dt.Rows[0]["SKU"].ToString(); r["UPC"] = dt.Rows[0]["UPC"].ToString(); r["Description"] = dt.Rows[0]["Description"].ToString(); r["SoLuong"] = txtsoluong.Value; r["GiaGoc"] = dt.Rows[0]["Price"].ToString(); r["ThanhTien"] = r["GiaGoc"]; if (dtKM.Rows.Count > 0) { r["Method"] = dtKM.Rows[0]["Method"].ToString(); r["DISCPRICE"] = dtKM.Rows[0]["DISCPRICE"].ToString(); r["QTY1"] = dtKM.Rows[0]["QTY1"].ToString(); if (dtKM.Rows[0]["Method"].ToString() == "25") { DataRow row; if (dtKM.Select("MeThod=25 and Prc_Key=Min(Prc_Key)").Length == 1) { row = dtKM.Select("MeThod=25 and Prc_Key=Min(Prc_Key)")[0]; } else { Int32 prc_key = Convert.ToInt32(dtKM.Select("MeThod=25 and Prc_Key=Min(Prc_Key)")[0]["Prc_key"]); row = dtKM.Select("MeThod=25 and Prc_Key=" + prc_key + " and Code=max(Code)")[0]; } //panel1.Visible = true; //labgiapos.Text = " " + Convert.ToDecimal(row["Price"]).ToString("N2");// +" Từ: " + Convert.ToDateTime(row["Start"]).ToString("dd/MM/yyyy") + " Đến:" + Convert.ToDateTime(row["Stop"]).ToString("dd/MM/yyyy"); //labslpos.Text = "1"; r["GiaKM"] = row["PRICE"].ToString(); r["ThanhTien"] = txtsoluong.Value * Convert.ToDecimal(r["GiaKM"]); } else if (dtKM.Rows[0]["Method"].ToString() == "2") { DataRow row; if (dtKM.Select("MeThod=2 and Prc_Key=Min(Prc_Key)").Length == 1) { row = dtKM.Select("MeThod=2 and Prc_Key=Min(Prc_Key)")[0]; } else { Int32 prc_key = Convert.ToInt32(dtKM.Select("MeThod=2 and Prc_Key=Min(Prc_Key)")[0]["Prc_key"]); row = dtKM.Select("MeThod=2 and Prc_Key=" + prc_key + " and Code=max(Code)")[0]; } //panel2.Visible = true; //labGiaKMTL.Text = "Khi mua với SL " + Convert.ToInt32(row["Qty1"]).ToString("N0") + " giá tiền là " + Convert.ToDecimal(row["DiscPrice"]).ToString("N2"); //+ " Từ: " + Convert.ToDateTime(row["Start"]).ToString("dd/MM/yyyy") + " Đến:" + Convert.ToDateTime(row["Stop"]).ToString("dd/MM/yyyy"); //labslKMTL.Text = Convert.ToInt32(row["Qty1"]).ToString("N0"); r["ThanhTien"] = (int)(txtsoluong.Value / Int32.Parse(Convert.ToDecimal(row["QTY1"]).ToString("N0"))) * Convert.ToDecimal(row["DISCPRICE"].ToString()) + (int)(txtsoluong.Value % Int32.Parse(Convert.ToDecimal(row["QTY1"]).ToString("N0"))) * Convert.ToDecimal(r["GiaGoc"]); r["GhiChu"] = "Mua SL " + row["QTY1"].ToString() + " co gia " + Convert.ToDecimal(row["DISCPRICE"]).ToString("N0"); } } else { r["GiaKM"] = r["GiaGoc"]; r["ThanhTien"] = Convert.ToDecimal(r["GiaGoc"]) * txtsoluong.Value; } _dsSKU.Rows.Add(r); _dsSKUAdd.Add((sku != string.Empty) ? sku : upc, _indexadd++); clearData(); txtSKU.Focus(); } GrDSSKU.DataSource = _dsSKU; //_dsSKUAdd.Add((sku != string.Empty) ? sku : upc, _indexadd++); //clearData(); }
public static void Info(object sender, string message, string details = null) { InfoMessage?.Invoke(sender, message, details); }
//Αναβάθμιση πύργου public void UpgradeTower() { int cost = TowerCost.getUpgradeCost(ttype, tlevel); if (this.GetComponent <Player>().Money >= cost) { if (tlevel < 3) { SelectedTower.GetComponentInChildren <Tower>().Towerlevel = tlevel + 1; //Γίνεται η αφαίρεση των χρημάτων για την αναβάθμιση και this.GetComponent <Player>().UpdateGold(-cost); //Eνημερώνονται οι μεταβλητές για τις ιδιότητες του πύργου int damage; float atk_cool; float proj_sp; int eff_val; float range; damage = TowerUpgrades.Damage; atk_cool = TowerUpgrades.Atk_cool; proj_sp = TowerUpgrades.Proj_sp; eff_val = TowerUpgrades.Eff_val; range = TowerUpgrades.Range; if (damage != 0) { SelectedTower.GetComponentInChildren <Tower>().Damage = damage; } if (atk_cool != 0) { SelectedTower.GetComponentInChildren <Tower>().AttackCooldown = atk_cool; } if (proj_sp != 0) { SelectedTower.GetComponentInChildren <Tower>().ProjectileSpeed = proj_sp; } if (eff_val != 0) { SelectedTower.GetComponentInChildren <Tower>().EffectValue = eff_val; } if (range != 0) { SelectedTower.transform.Find("Range").transform.localScale = new Vector3(range, range, 1); SelectedTower.GetComponentInChildren <Tower>().UpdateRange(); } CancelTowerMenu(); } else { InfoMessage.GetComponent <ShowInfoText>().displayMessage(4); } } }
private void SetInfoMessage(string message, Color color, double duration = -1) { infoMessage = new InfoMessage { message = message, color = color, messageTime = EditorApplication.timeSinceStartup, messageDuration = duration }; }
public void Stop() { _cancellationTokenSource?.Cancel(); InfoMessage?.Invoke(this, "Обработка файла отменена"); }
/// <summary> /// Redirects response to the info page. /// </summary> /// <param name="infoMessage"> /// The info Message. /// </param> public static void RedirectInfoPage(InfoMessage infoMessage) { Redirect(ForumPages.info, "i={0}".FormatWith(infoMessage.ToType<int>())); }
public void InfoMessage() { var message = new InfoMessage("asdasd"); Assert.NotNull(SerializeAndBack(message)); }
private void BTHienthi_Click(object sender, EventArgs e) { WaitingMsg waitingMsg = new WaitingMsg("Chương trình đang load dữ liệu!", "Please Waiting ......."); try { _tbDSGia.Clear(); copyfile(Config._pathfileWinDSS); //TPSDataAccess access = new TPSDataAccess(Path.Combine(CTLConfig._pathfileWinDSS, "INVMST")); TPSDataAccess access = new TPSDataAccess(_PathFileINVMST); TPSDataAccess accessPathWSS = new TPSDataAccess(Path.Combine(Config._pathfileWinDSS, "SYSMST")); SQLHelper helper = new SQLHelper(true); string MaST = "0"; MaST = accessPathWSS.getMaSieuthi(); _storeName = MaST; helper.AddParameterToSQLCommand("@STR", SqlDbType.NVarChar, 8); helper.SetSQLCommandParameterValue("@STR", MaST); if (MaST == "0") { InfoMessage.HienThi("Khong lay duoc StoreNumber " + MaST + " ", "Vui long lien he voi quan tri", "Loi Get StoreNumber", HinhAnhThongBao.LOI, NutThongBao.DONGY); return; } string strconf = ""; string strsale = ""; string strupc = ""; if (!radConfirAll.Checked) { strconf = " and CONF_PRICE=" + (radconfirYes.Checked ? "'Y'" : "'N'"); helper.AddParameterToSQLCommand("@ISTYPE", SqlDbType.NVarChar, 8); helper.SetSQLCommandParameterValue("@ISTYPE", (radconfirNo.Checked) ? "01" : "CS"); } if (!radsaleAll.Checked) { strsale = " and SELL_UNIT=" + (radsaleEA.Checked ? "'EA'" : "'KG'"); helper.AddParameterToSQLCommand("@ISLUM", SqlDbType.NVarChar, 8); helper.SetSQLCommandParameterValue("@ISLUM", (radsaleKG.Checked) ? radsaleKG.Text : radsaleEA.Text); } if (!radUPCALL.Checked) { strupc = " and UPC<>''"; helper.AddParameterToSQLCommand("@ISUPC", SqlDbType.NVarChar, 8); helper.SetSQLCommandParameterValue("@ISUPC", 1); } DataTable dt = helper.GetDatatableBySP("PRLN_spGetPricebyStore"); string sql = string.Format("Select SKU,Price,Description from INVMST where 1=1 {0}{1}{2} order by SKU", strconf, strsale, strupc); DataTable tbg = access.GetDataTable(sql); int dem = 0; foreach (DataRow dataRow in dt.Rows) { decimal p = Convert.ToDecimal(dataRow["PLNITM"].ToString()); for (int i = dem; i < tbg.Rows.Count; i++) { decimal pMMS = Convert.ToDecimal(tbg.Rows[i]["SKU"].ToString()); if (p == pMMS) { if (Convert.ToDecimal(tbg.Rows[i]["Price"]) != Convert.ToDecimal(dataRow["PLNAMT"].ToString())) { DataRow r = _tbDSGia.NewRow(); r["SKU"] = "00" + dataRow["PLNITM"].ToString(); r["Check"] = false; r["Description"] = tbg.Rows[i]["Description"].ToString(); r["Price"] = Convert.ToDecimal(dataRow["PLNAMT"].ToString()); r["PriceMMS"] = Convert.ToDecimal(tbg.Rows[i]["Price"]); _tbDSGia.Rows.Add(r); } dem = i + 1; break; } else if (pMMS > p) { dem = i; break; } } } GrDSPriceSKU.DataSource = _tbDSGia; waitingMsg.Finish(); } catch (Exception exception) { CTLError.WriteError("btLoadData ", exception.Message); waitingMsg.Finish(); return; throw; } }
private void LogSlideProcessing(string prefix, Slide slide) { InfoMessage?.Invoke(prefix + " " + slide.Info.Unit.Title + " - " + slide.Title); }
protected override void OnEnable() { base.OnEnable(); m_startNode = (StartNode)target; m_infoMessageNotConnected = new InfoMessage(InfoMessage.MessageType.Error, UILabels.NotConnectedTitle, UILabels.NotConnectedMessage); }
/// <summary> 命令通用方法 </summary> protected override async void RelayMethod(object obj) { string command = obj?.ToString(); // Do:对话消息 if (command == "Button.ShowDialogMessage") { await MessageService.ShowSumitMessge("这是消息对话框?"); } // Do:等待消息 else if (command == "Button.ShowWaittingMessge") { await MessageService.ShowWaittingMessge(() => Thread.Sleep(2000)); } // Do:百分比进度对话框 else if (command == "Button.ShowPercentProgress") { Action <IPercentProgress> action = l => { for (int i = 0; i < 100; i++) { l.Value = i; Thread.Sleep(10); } Thread.Sleep(1000); MessageService.ShowSnackMessageWithNotice("加载完成!"); }; await MessageService.ShowPercentProgress(action); } // Do:文本进度对话框 else if (command == "Button.ShowStringProgress") { Action <IStringProgress> action = l => { for (int i = 1; i <= 100; i++) { l.MessageStr = $"正在提交当前页第{i}份数据,共100份"; Thread.Sleep(10); } Thread.Sleep(1000); MessageService.ShowSnackMessageWithNotice("提交完成:成功100条,失败0条!"); }; await MessageService.ShowStringProgress(action); } // Do:确认取消对话框 else if (command == "Button.ShowResultMessge") { var result = await MessageService.ShowResultMessge("确认要退出系统?"); if (result) { MessageService.ShowSnackMessageWithNotice("你点击了取消"); } else { MessageService.ShowSnackMessageWithNotice("你点击了确定"); } } // Do:提示消息 else if (command == "Button.ShowSnackMessage") { MessageService.ShowSnackMessageWithNotice("这是提示消息?"); } // Do:气泡消息 else if (command == "Button.ShowNotifyMessage") { MessageService.ShowNotifyMessage("你有一条报警信息需要处理,请检查", "Notify By HeBianGu"); } // Do:气泡消息 else if (command == "Button.ShowIdentifyNotifyMessage") { MessageService.ShowNotifyDialogMessage("自定义气泡消息" + DateTime.Now.ToString("yyyy-mm-dd HH:mm:ss"), "友情提示", 5); } // Do:气泡消息 else if (command == "Button.ShowWindowSumitMessage") { MessageWindow.ShowSumit("这是窗口提示消息"); } // Do:气泡消息 else if (command == "Button.ShowWindowResultMessage") { MessageWindow.ShowDialog("这是窗口提示消息"); } // Do:气泡消息 else if (command == "Button.ShowWindowIndentifyMessage") { List <Tuple <string, Action <MessageWindow> > > acts = new List <Tuple <string, Action <MessageWindow> > >(); Action <MessageWindow> action = l => { l.CloseAnimation(l); l.Result = true; MessageService.ShowSnackMessageWithNotice("你点到我了!"); }; acts.Add(Tuple.Create("按钮一", action)); acts.Add(Tuple.Create("按钮二", action)); acts.Add(Tuple.Create("按钮三", action)); MessageWindow.ShowDialogWith("这是自定义按钮提示消息", "好心提醒", false, acts.ToArray()); } // Do:气泡消息 else if (command == "Button.Upgrade") { UpgradeWindow window = new UpgradeWindow(); window.TitleMessage = "发现新版本:V3.0.1"; List <string> message = new List <string>(); message.Add("1、增加了检验更新和版本下载"); message.Add("2、增加了Mvc跳转页面方案"); message.Add("3、修改了一些已知BUG"); window.Message = message; var find = window.ShowDialog(); if (find.HasValue && find.Value) { DownLoadWindow downLoad = new DownLoadWindow(); downLoad.TitleMessage = "正在下载新版本:V3.0.1"; downLoad.Url = @"http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4"; downLoad.Message = message; downLoad.ShowDialog(); } //UpgradeWindow.BeginUpgrade("发现新版本:V3.0.1", @"http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4", // message.ToArray()); } // Do:气泡消息 else if (command.StartsWith("Button.Message.Error")) { ErrorMessage message = new ErrorMessage(); message.Message = "错误信息!"; this.AddMessage(message, command); } // Do:气泡消息 else if (command.StartsWith("Button.Message.Info")) { InfoMessage message = new InfoMessage(); message.Message = "提示信息!"; this.AddMessage(message, command); } // Do:气泡消息 else if (command.StartsWith("Button.Message.Success")) { SuccessMessage message = new SuccessMessage(); message.Message = "保存成功!"; this.AddMessage(message, command); } // Do:气泡消息 else if (command.StartsWith("Button.Message.Fatal")) { FatalMessage message = new FatalMessage(); message.Message = "问题很严重!"; this.AddMessage(message, command); } // Do:气泡消息 else if (command.StartsWith("Button.Message.Warn")) { WarnMessage message = new WarnMessage(); message.Message = "警告信息!"; this.AddMessage(message, command); } // Do:气泡消息 else if (command.StartsWith("Button.Message.Dailog")) { DailogMessage message = new DailogMessage(); message.Message = "可以保存了么?"; this.AddMessage(message, command); } // Do:气泡消息 else if (command.StartsWith("Button.ShowCoverMessge")) { SettingControl setting = new SettingControl(); MessageService.ShowWithLayer(setting); } else if (command == "Button.Add") { if (this.StoryBoardPlayerViewModel.PlayMode) { MessageService.ShowSnackMessageWithNotice("请先停止播放再进行添加!"); return; } this.StoryBoardPlayerViewModel.Create(); } else if (command == "init") { for (int i = 0; i < 60; i++) { ComboBoxItems.Add(new FComboBoxItemModel() { Header = "ComboBoxItem" + (ComboBoxItems.Count + 1), Value = (ComboBoxItems.Count + 1), CanDelete = true }); } } }
protected override void OnEnable() { base.OnEnable(); m_infoMessageErrorNoGraphReferenced = new InfoMessage(InfoMessage.MessageType.Error, UILabels.NoGraphReferencedTitle, UILabels.NoGraphReferencedMessage); m_infoMessageErrorReferencedGraphIsSubGraph = new InfoMessage(InfoMessage.MessageType.Error, UILabels.ReferencedGraphIsSubGraphTitle, UILabels.ReferencedGraphIsSubGraphMessage); }
public static bool InsertDonDatHang(EntityDonDatHang dh, DataTable ctdh) { SQLHelper sqlHelper = new SQLHelper(); decimal soluong = 0; decimal thanhtien = 0; try { sqlHelper.BeginTransaction("InsertDDH"); string sql = string.Format(@" INSERT INTO [" + Config._DBNameFrontEnd + @"].dbo.DonDatHang ( ID, HoTen, DienThoai, DiaChi, SoLuong, ThanhTien, NgayTao, GhiChu ) VALUES ( '{0}'/* ID */, '{1}'/* HoTen */, '{2}'/* DienThoai */, '{3}'/* DiaChi */, {4}/* SoLuong */, {5}/* ThanhTien */, @ngaytao/* NgayTao */, '{6}'/* GhiChu */ )", dh.ID, dh.HoTen, dh.DT, dh.DiaChi, dh.SoLuong, dh.ThanTien, dh.GhiChu); sqlHelper.AddParameterToSQLCommand("@ngaytao", SqlDbType.DateTime); //sqlHelper.AddParameterToSQLCommand("@image", SqlDbType.Image); sqlHelper.SetSQLCommandParameterValue("@ngaytao", dh.NgayTao); //sqlHelper.SetSQLCommandParameterValue("@image", a.Image); bool kq = sqlHelper.GetExecuteNonQueryByCommand(sql) > 0; if (!kq) { InfoMessage.HienThi("Lưu đơn hàng không thành công!", "Lưu đơn đặt hàng", "Thong Bao", HinhAnhThongBao.LOI, NutThongBao.DONGY); return(false); } foreach (DataRow row in ctdh.Rows) { EntityCTDonDatHang ct = new EntityCTDonDatHang(); ct.ID = Guid.NewGuid().ToString(); ct.IDDonDatHang = dh.ID; ct.SKU = row["SKU"].ToString(); ct.UPC = row["UPC"].ToString(); ct.GhiChu = ("" + row["GhiChu"]).ToString(); ct.TenSP = row["Description"].ToString(); ct.SoLuong = Convert.ToDecimal(row["SoLuong"]); ct.GiaGoc = Convert.ToDecimal(row["GiaGoc"]); ct.GiaKM = Convert.ToDecimal("0" + row["GiaKM"]); ct.ThanTien = Convert.ToDecimal(row["ThanhTien"]); kq &= InsertCTDDH(ct); soluong += ct.SoLuong; thanhtien += ct.ThanTien; } //kq &= UpdateDonDatHang(dh.ID, soluong, thanhtien); if (!kq) { InfoMessage.HienThi("Lưu đơn hàng không thành công!", "Lưu đơn đặt hàng", "Thong Bao", HinhAnhThongBao.LOI, NutThongBao.DONGY); return(false); } sqlHelper.Commit(); InfoMessage.HienThi("Lưu đơn hàng thành công!!!", "Lưu đơn đặt hàng", "Thong Bao", HinhAnhThongBao.THANHCONG, NutThongBao.DONGY); return(true); } catch (Exception ex) { sqlHelper.Rollback("InsertDDH"); InfoMessage.HienThi("Lưu đơn hàng không thành công!", "Lưu đơn đặt hàng", "Thong Bao", HinhAnhThongBao.LOI, NutThongBao.DONGY); CTLError.WriteError("InsertDonDatHang ", ex.Message); return(false); throw; } }
private void InfoMessageEvent(object sender, SqlInfoMessageEventArgs e) { InfoMessage?.Invoke(_connection, e); }
private void HandleInfo(string json) { InfoMessage info = JsonSerializer.Deserialize <InfoMessage>(json, DefaultJsonSerializerOptions); // noop }
internal void OnInfoMessage(string message) => InfoMessage?.Invoke(message);
public static MvcHtmlString PageEditorInfo(this HtmlHelper helper, string infoMessage) { return(Context.PageMode.IsNormal ? new MvcHtmlString(string.Empty) : helper.Partial(Constants.InfoMessageView, InfoMessage.Info(infoMessage))); }
public void ReceiveMessage(InfoMessage infoMessage) { try { InstanceAnswerPro.Core.Buddy sender = ComponentManager.GetBuddyListBuilder().FindOrCreateBuddy(infoMessage.Uin, true); if (sender != null) { this.AddMsg(sender, infoMessage.Time, infoMessage.MessagePack); } } catch (Exception) { } }
/// <summary> /// Redirects response to the info page. /// </summary> /// <param name="infoMessage"> /// The info Message. /// </param> public static void RedirectInfoPage(InfoMessage infoMessage) { Redirect(ForumPages.info, "i={0}".FormatWith(infoMessage.ToType <int>())); }
internal void OnInfoMessage(MySqlInfoMessageEventArgs args) { InfoMessage?.Invoke(this, args); }
public void ForgotPassword_ValidPassword_ShouldReturnSuccessView([Frozen] IAccountRepository repo, INotificationService ns, PasswordResetInfo model, IAccountsSettingsService accountSetting, InfoMessage info) { var fakeSite = new FakeSiteContext(new StringDictionary { { "displayMode", "normal" } }) as SiteContext; using (new SiteContextSwitcher(fakeSite)) { var controller = new AccountsController(repo, ns, accountSetting, null, null, null); repo.RestorePassword(Arg.Any <string>()).Returns("new password"); repo.Exists(Arg.Any <string>()).Returns(true); var result = controller.ForgotPassword(model); result.Should().BeOfType <ViewResult>().Which.ViewName.Should().Be(Constants.InfoMessageView); } }
public void ForgotPasswordShouldReturnSuccessView([Frozen] IAccountRepository repo, INotificationService ns, PasswordResetInfo model, IAccountsSettingsService accountSetting, InfoMessage info) { var fakeSite = new FakeSiteContext(new StringDictionary { { "displayMode", "normal" } }) as SiteContext; using (new SiteContextSwitcher(fakeSite)) { var controller = new AccountsController(repo, ns, accountSetting, null, null); repo.RestorePassword(Arg.Any<string>()).Returns("new password"); repo.Exists(Arg.Any<string>()).Returns(true); var result = controller.ForgotPassword(model); result.Should().BeOfType<ViewResult>().Which.ViewName.Should().Be(ViewPath.InfoMessage); } }
public ActionResult New(int? animationId, string name) { try { Context.MediaSets.AddObject(new MediaSet() { AnimationId = animationId.HasValue ? animationId.Value : Customer.Animations.First().AnimationId, Name = String.IsNullOrWhiteSpace(name) ? "Nieuwe fotoset" : name, StartDate = DateTime.Now, EndDate = DateTime.Now.AddDays(7) }); Context.SaveChanges(); TempData["message"] = new InfoMessage("Nieuwe set is aangemaakt.", InfoMessage.InfoType.Notice); } catch (Exception e) { Elmah.ErrorSignal.FromCurrentContext().Raise(e); TempData["message"] = new InfoMessage("Er is een fout opgetreden bij het maken van de set.", InfoMessage.InfoType.Error); } return RedirectToAction("Index"); }
protected abstract string HandleRequest(InfoMessage message);
public static MvcHtmlString PageEditorError(this HtmlHelper helper, string errorMessage) { Log.Error($@"Presentation error: {errorMessage}", typeof(AlertHtmlHelpers)); return(Context.PageMode.IsNormal ? new MvcHtmlString(string.Empty) : helper.Partial(Constants.InfoMessageView, InfoMessage.Error(errorMessage))); }
private void TakoDbContext_InfoMessage(object sender, SqlInfoMessageEventArgs e) { InfoMessage?.Invoke(sender, e); }
public override AMove CreateNextMove(Game.Game game, Dictionary <string, string> dictVariables) { var result = Validate(game.World, dictVariables); var withoutFunctionFormula = CreateFormulaWithoutFunctions(game, dictVariables); if (game.Guess) { if (result.Value == EValidationResult.True) { if (withoutFunctionFormula != null) { var endMessage = new EndMessage(game, this, $"You win:\n{withoutFunctionFormula.ReformatFormula(dictVariables)}\nis true in this world.", true); var infoFunctionFormula = new InfoMessage(game, withoutFunctionFormula, $"So you believe that \n{withoutFunctionFormula.ReformatFormula(dictVariables)}\n is true", endMessage); var infoMessage = new InfoMessage(game, withoutFunctionFormula, $"So you believe that \n{ReformatFormula(dictVariables)}\n is true", infoFunctionFormula); return(infoMessage); } else { var endMessage = new EndMessage(game, this, $"You win:\n{ReformatFormula(dictVariables)}\nis true in this world.", true); var infoMessage = new InfoMessage(game, this, $"So you believe that \n{ReformatFormula(dictVariables)}\n is true", endMessage); return(infoMessage); } } else { if (withoutFunctionFormula != null) { var endMessage = new EndMessage(game, this, $"You lose:\n{withoutFunctionFormula.ReformatFormula(dictVariables)}\nis false, not true, in this world.", false); var infoFunctionFormula = new InfoMessage(game, withoutFunctionFormula, $"So you believe that \n{withoutFunctionFormula.ReformatFormula(dictVariables)}\n is true", endMessage); var infoMessage = new InfoMessage(game, withoutFunctionFormula, $"So you believe that \n{ReformatFormula(dictVariables)}\n is false", infoFunctionFormula); return(infoMessage); } else { var endMessage = new EndMessage(game, this, $"You lose:\n{ReformatFormula(dictVariables)}\nis false, not true, in this world.", false); var infoMessage = new InfoMessage(game, this, $"So you believe that \n{ReformatFormula(dictVariables)}\n is true", endMessage); return(infoMessage); } } } else { if (result.Value == EValidationResult.True) { if (withoutFunctionFormula != null) { var endMessage = new EndMessage(game, this, $"You lose:\n{withoutFunctionFormula.ReformatFormula(dictVariables)}\nis true, not false, in this world.", false); var infoFunctionFormula = new InfoMessage(game, withoutFunctionFormula, $"So you believe that \n{withoutFunctionFormula.ReformatFormula(dictVariables)}\n is false", endMessage); var infoMessage = new InfoMessage(game, withoutFunctionFormula, $"So you believe that \n{ReformatFormula(dictVariables)}\n is false", infoFunctionFormula); return(infoMessage); } else { var endMessage = new EndMessage(game, this, $"You lose:\n{ReformatFormula(dictVariables)}\nis true, not false, in this world.", false); var infoMessage = new InfoMessage(game, this, $"So you believe that \n{ReformatFormula(dictVariables)}\n is false", endMessage); return(infoMessage); } } else { if (withoutFunctionFormula != null) { var endMessage = new EndMessage(game, this, $"You win:\n{withoutFunctionFormula.ReformatFormula(dictVariables)}\nis false in this world.", true); var infoFunctionFormula = new InfoMessage(game, withoutFunctionFormula, $"So you believe that \n{withoutFunctionFormula.ReformatFormula(dictVariables)}\n is false", endMessage); var infoMessage = new InfoMessage(game, withoutFunctionFormula, $"So you believe that \n{ReformatFormula(dictVariables)}\n is false", infoFunctionFormula); return(infoMessage); } else { var endMessage = new EndMessage(game, this, $"You win:\n{ReformatFormula(dictVariables)}\nis false in this world.", true); var infoMessage = new InfoMessage(game, this, $"So you believe that \n{ReformatFormula(dictVariables)}\n is false", endMessage); return(infoMessage); } } } }
public static MvcHtmlString PageEditorError(this HtmlHelper helper, string errorMessage, string friendlyMessage, ID contextItemId, ID renderingId) { Log.Error($@"Presentation error: {errorMessage}, Context item ID: {contextItemId}, Rendering ID: {renderingId}", typeof(AlertHtmlHelpers)); return(Context.PageMode.IsNormal ? new MvcHtmlString(string.Empty) : helper.Partial(Constants.InfoMessageView, InfoMessage.Error(friendlyMessage))); }
public virtual ActionResult EditProfile(EditProfile profile) { if (this.userProfileService.GetUserDefaultProfileId() != Context.User.Profile.ProfileItemId) { return this.InfoMessage(InfoMessage.Error(Errors.ProfileMismatch)); } if (!this.userProfileService.ValidateProfile(profile, this.ModelState)) { profile.InterestTypes = this.userProfileService.GetInterests(); return this.View(profile); } this.userProfileService.SetProfile(Context.User.Profile, profile); if (this.contactProfileService != null) { this.contactProfileService.SetProfile(profile); } Session["EditProfileMessage"] = new InfoMessage(Captions.EditProfileSuccess); return this.Redirect(Request.RawUrl); }
private void OnWarningMessage(IscException warning) { InfoMessage?.Invoke(this, new FbInfoMessageEventArgs(warning)); }
private void btnManualSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (isComment) { CTLSearchBug searchBug = new CTLSearchBug(); string ten = Config._tennv + "-" + Config._tenst; if (searchBug.InsertFeedBack(_IDIsuee, Editor.Document.RtfText, (ten.Length > 36) ? ten.Substring(0, 36) : ten.Substring(0, ten.Length), "")) { _isfinish = true; } return; } _isload = true; _isModify = false; //if (isNew) //{ // // Khi lưu phải lưu những phần DocumentIssue, DocumentDetail,Attachment // string applicationName = AppName; // string item = Item; // string eventIssue = Event; // string idNhanVien = IDNhanVien; // string content = Editor.Document.RtfText; // string version = txtVersion.Text; // string reference = txtReference.Text; // CTLXuLyAddNewApplication_Master control = new CTLXuLyAddNewApplication_Master(); // try // { // control.AddNewEvent(applicationName, item, eventIssue, idNhanVien, content, version, // reference, lstFullFileName, lstFileName); // } // catch (Exception ex) // { // FrmMessage frm = new FrmMessage("Thêm mới không thành công. Vui lòng kiểm tra lại thông tin"); // frm.Show(); // return; // } // FrmMessage frm2 = new FrmMessage("Thêm mới thành công"); // frm2.Show(); // btnManualSave.Enabled = true; // return; //} //else //{ // Cập nhật detail: string applicationName = AppName; string item = Item; string eventIssue = Event; string idNhanVien = IDNhanVien; StringBuilder content = new StringBuilder(); content.Append(Editor.Document.RtfText); string version = txtVersion.Text; string reference = txtReference.Text; try { //int a = control.UpdateDocument_Detail(ID, content,version,reference,Att_Title,lstFileName); if (CompareAttachment(content.ToString(), version, reference, Att_Title)) { //FrmMessage frm1 = new FrmMessage("Cập nhật thành công"); //frm1.ShowDialog(); InfoMessage.HienThi("Cập nhật thành công", "Update", "Thông báo", HinhAnhThongBao.THANHCONG, NutThongBao.DONGY); lstFileName.Clear(); lstFullFileName.Clear(); return; } else { //FrmMessage frm = new FrmMessage("Cập nhật không thành công. Vui lòng kiểm tra lại thông tin"); //frm.ShowDialog(); InfoMessage.HienThi("Cập nhật không thành công", "Update", "Thông báo", HinhAnhThongBao.LOI, NutThongBao.DONGY); lstFileName.Clear(); lstFullFileName.Clear(); return; } } catch (Exception ex) { //FrmMessage frm = new FrmMessage("Cập nhật không thành công. Vui lòng kiểm tra lại thông tin"); //frm.ShowDialog(); InfoMessage.HienThi("Cập nhật không thành công. Vui lòng kiểm tra lại thông tin", "Update", "Thông báo", HinhAnhThongBao.LOI, NutThongBao.DONGY); lstFileName.Clear(); lstFullFileName.Clear(); return; } //} }
public virtual int Add(InfoMessage newInfoMessage) { return(this.List.Add(newInfoMessage)); }