protected override void Execute(NativeActivityContext context) { try { Advantech.Myadvantech.Business.QuoteBusinessLogic.SendApproveEmail(QuoteID.Get(context), Region.Get(context)); } catch (Exception ex) { string subject = String.Format("eQ3.0 approval process errors, quote Id: {0}", QuoteID.Get(context)); string strContent = String.Format("<p> eQ3.0 approval process errors in {0}</p>", DateTime.Now.ToString()); strContent += String.Format("<p>Quote Id: {0}</p>", QuoteID.Get(context)); strContent += ex.Message; MailHelper.SendMail("*****@*****.**", subject, strContent); } if (IsCreateBookmark.Get(context) == true) { context.CreateBookmark("Waiting for approval", new BookmarkCallback(this.OnBookmarkCallback)); } }
public override void onMessage(QuickFix44.QuoteStatusReport message, SessionID session) { // getting attributes QuoteID quoteID = message.getQuoteID(); Symbol symbol = message.getSymbol(); QuoteType quoteType = message.getQuoteType(); QuoteAvailability qfhQuoteInfo = new QuoteAvailability() { QuoteID = quoteID, Symbol = symbol, QuoteType = quoteType, }; // firing event //Console.WriteLine("QuickFix44.QuoteStatusReport: {0}, {1}, {2}", quoteID, symbol, quoteType); this.fixServices.NotifyQuoteStatus(qfhQuoteInfo); }
public override int GetHashCode() { int hash = 1; if (QuoteID.Length != 0) { hash ^= QuoteID.GetHashCode(); } if (Exchange.Length != 0) { hash ^= Exchange.GetHashCode(); } if (Symbol.Length != 0) { hash ^= Symbol.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public void FillProduct() { ArrayList pp = new ArrayList(); if (!FromQuote) { DataSet ds = DatabaseConnection.CreateDataset("SELECT * FROM CRM_BILL WHERE ID=" + PurchaseID); Purchase_ID.Text = PurchaseID.ToString(); Purchase_BillingDate.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["BillingDate"]).ToShortDateString(); Purchase_PaymentDate.Text = (ds.Tables[0].Rows[0]["PaymentDate"] != DBNull.Value) ? Convert.ToDateTime(ds.Tables[0].Rows[0]["PaymentDate"]).ToShortDateString() : ""; Purchase_ExpirationDate.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["ExpirationDate"]).ToShortDateString(); Purchase_BillNumber.Text = ds.Tables[0].Rows[0]["BillNumber"].ToString(); Purchase_Note.Text = ds.Tables[0].Rows[0]["Note"].ToString(); Purchase_Payment.Checked = (bool)ds.Tables[0].Rows[0]["Payment"]; if ((long)ds.Tables[0].Rows[0]["OwnerID"] > 0) { this.Purchase_TextboxOwnerID.Text = ds.Tables[0].Rows[0]["OwnerID"].ToString(); this.Purchase_TextboxOwner.Text = DatabaseConnection.SqlScalar("SELECT ISNULL(NAME,'')+' '+ISNULL(SURNAME,'') AS OWNER FROM ACCOUNT WHERE UID=" + ds.Tables[0].Rows[0]["OwnerID"].ToString()); } else { this.Purchase_TextboxOwnerID.Text = string.Empty; this.Purchase_TextboxOwner.Text = string.Empty; } ds.Clear(); ds = DatabaseConnection.CreateDataset("SELECT * FROM CRM_BILLROWS WHERE BILLID=" + PurchaseID); foreach (DataRow d in ds.Tables[0].Rows) { PurchaseProduct Pprod = new PurchaseProduct(); Pprod.id = Convert.ToInt64(d["ProductID"]); Pprod.ShortDescription = DatabaseConnection.SqlScalar("SELECT SHORTDESCRIPTION FROM CATALOGPRODUCTS WHERE ID=" + d["ProductID"].ToString()); Pprod.LongDescription = d["Description"].ToString(); Pprod.UM = (string)d["UM"]; Pprod.Qta = (int)d["Qta"]; Pprod.UnitPrice = (decimal)d["UnitPrice"]; Pprod.Vat = Convert.ToInt32(d["Tax"]); Pprod.ListPrice = (decimal)d["ListPrice"]; Pprod.FinalPrice = (decimal)d["FinalPrice"]; Pprod.ObId = pp.Count; pp.Add(Pprod); } } else { DataSet ds = DatabaseConnection.CreateDataset("SELECT * FROM QUOTE_VIEW WHERE QUOTEID=" + this.QuoteID); Purchase_ID.Text = QuoteID.ToString(); Purchase_BillingDate.Text = DateTime.Now.ToShortDateString(); Purchase_PaymentDate.Text = String.Empty; Purchase_ExpirationDate.Text = String.Empty; Purchase_BillNumber.Text = String.Empty; Purchase_Note.Text = ds.Tables[0].Rows[0]["Description"].ToString(); Purchase_Payment.Checked = false; if ((int)ds.Tables[0].Rows[0]["OwnerID"] > 0) { this.Purchase_TextboxOwnerID.Text = ds.Tables[0].Rows[0]["OwnerID"].ToString(); this.Purchase_TextboxOwner.Text = DatabaseConnection.SqlScalar("SELECT ISNULL(NAME,'')+' '+ISNULL(SURNAME,'') AS OWNER FROM ACCOUNT WHERE UID=" + ds.Tables[0].Rows[0]["OwnerID"].ToString()); } else { this.Purchase_TextboxOwnerID.Text = string.Empty; this.Purchase_TextboxOwner.Text = string.Empty; } ds.Clear(); DataTable dt = DatabaseConnection.CreateDataset("SELECT * FROM ESTIMATEDROWS WHERE ESTIMATEID=" + QuoteID).Tables[0]; foreach (DataRow ddr in dt.Rows) { if (ddr["CatalogID"].ToString() != "0") { DataSet tempNP = DatabaseConnection.CreateDataset("SELECT * FROM CATALOGPRODUCTS WHERE ID=" + ddr["CatalogID"].ToString()); if (tempNP.Tables[0].Rows.Count > 0) { DataRow pInfo = tempNP.Tables[0].Rows[0]; PurchaseProduct newprod = new PurchaseProduct(); newprod.id = Convert.ToInt64(ddr["CatalogID"]); newprod.ShortDescription = pInfo["ShortDescription"].ToString(); newprod.LongDescription = pInfo["LongDescription"].ToString(); newprod.UM = pInfo["Unit"].ToString(); newprod.Qta = (double)ddr["Qta"]; newprod.UnitPrice = (decimal)ddr["Uprice"]; newprod.Vat = (pInfo["Vat"] != DBNull.Value) ? (decimal)pInfo["Vat"] : 0; newprod.ListPrice = Math.Round(Convert.ToDecimal(newprod.Qta) * newprod.UnitPrice, 2); newprod.FinalPrice = (decimal)ddr["NewUPrice"]; try { newprod.Reduction = (int)ddr["reduction"]; } catch { newprod.Reduction = 0; } pp.Add(newprod); } } else { PurchaseProduct newprod = new PurchaseProduct(); newprod.id = 0; newprod.ShortDescription = ddr["Description"].ToString(); newprod.LongDescription = ddr["Description"].ToString(); newprod.UM = ""; newprod.Qta = (double)ddr["qta"]; newprod.UnitPrice = (decimal)ddr["Uprice"]; newprod.Vat = 0; newprod.ListPrice = Math.Round(Convert.ToDecimal(newprod.Qta) * newprod.UnitPrice, 2); newprod.FinalPrice = (decimal)ddr["NewUPrice"]; try { newprod.Reduction = (int)ddr["reduction"]; } catch { newprod.Reduction = 0; } pp.Add(newprod); } } } Session["newBillProd"] = pp; RepeaterPurchaseProduct.DataSource = pp; RepeaterPurchaseProduct.DataBind(); RepeaterPurchaseProduct.Visible = true; }