public static int UpdateOrderforDelivery(WebOrders wsOrder) { int isUpdate = 0; try { string query = SQLClass.UPDATE_ORDER_FOR_Delivery; NpgsqlCommand command = new NpgsqlCommand(query); command.CommandType = CommandType.Text; command.Parameters.Add("order_id", wsOrder.OrderID); command.Parameters.Add("shipping_method", wsOrder.ShippingMethod); command.Parameters.Add("delivery_date", wsOrder.DeliveryDate); command.Parameters.Add("cust_name", wsOrder.CustName); command.Parameters.Add("cust_contact", wsOrder.CustContact); command.Parameters.Add("delivery_address", wsOrder.DeliveryAddress); command.Parameters.Add("delivery_zipcode", wsOrder.DeliveryZipcode); command.Parameters.Add("delivery_city", wsOrder.DeliveryCity); command.Parameters.Add("delivery_country", wsOrder.DeliveryCountry); IDatabaseFactory dbFactory = new DatabaseFactory(); IDatabase dbObject = dbFactory.CreateDatabaseInstance(ACTIVE_DATABASE); isUpdate = dbObject.ExecuteQuery(command); } catch (Exception ex) { Hey.Common.Utils.LogWriter.Log(ex.Message); } return(isUpdate); }
public static int UpdateAdditionalInfo(WebOrders wsOrder) { int isUpdate = 0; try { string query = SQLClass.UPDATE_ADDITIONAL_INFO; NpgsqlCommand command = new NpgsqlCommand(query); command.CommandType = CommandType.Text; command.Parameters.Add("order_id", wsOrder.OrderID); command.Parameters.Add("cust_code", wsOrder.CustCode); command.Parameters.Add("order_descr", wsOrder.OrderDescription); command.Parameters.Add("total_order_with_vat", wsOrder.TotalOrderWithVat); command.Parameters.Add("total_order", wsOrder.TotalOrder); command.Parameters.Add("prodnotes", wsOrder.ProdNotes); IDatabaseFactory dbFactory = new DatabaseFactory(); IDatabase dbObject = dbFactory.CreateDatabaseInstance(ACTIVE_DATABASE); isUpdate = dbObject.ExecuteQuery(command); } catch (Exception ex) { Hey.Common.Utils.LogWriter.Log(ex.Message); } return(isUpdate); }
public static int InsertShoppingOrder(WebOrders webOrder) { int OrderId = 0; try { string query = SQLClass.INSERT_INTO_WEB_ORDER; NpgsqlCommand command = new NpgsqlCommand(query); command.CommandType = CommandType.Text; command.Parameters.Add("order_code", webOrder.OrderCode); command.Parameters.Add("order_type", webOrder.OrderType); command.Parameters.Add("order_descr", webOrder.OrderDescription); command.Parameters.Add("order_date", webOrder.OrderDate); command.Parameters.Add("order_status", webOrder.OrderStatus); command.Parameters.Add("cust_code", webOrder.CustCode); command.Parameters.Add("cust_name", webOrder.CustName); command.Parameters.Add("cust_contact", webOrder.CustContact); command.Parameters.Add("cust_phone", webOrder.CustPhone); command.Parameters.Add("cust_email", webOrder.CustEmail); command.Parameters.Add("cust_ref", webOrder.CustRef); command.Parameters.Add("delivery_date", webOrder.DeliveryDate); command.Parameters.Add("delivery_address", webOrder.DeliveryAddress); command.Parameters.Add("delivery_zipcode", webOrder.DeliveryZipcode); command.Parameters.Add("delivery_city", webOrder.DeliveryCity); command.Parameters.Add("delivery_country", webOrder.DeliveryCountry); command.Parameters.Add("shipping_method", webOrder.ShippingMethod); command.Parameters.Add("shipping_cost", webOrder.ShippingCost); command.Parameters.Add("total_items", webOrder.TotalItems); command.Parameters.Add("discount_items", webOrder.DiscountItems); command.Parameters.Add("discount_other", webOrder.DiscountOther); command.Parameters.Add("total_vat", webOrder.TotalVat); command.Parameters.Add("total_order", webOrder.TotalOrder); command.Parameters.Add("total_order_with_vat", webOrder.TotalOrderWithVat); command.Parameters.Add("remarks", webOrder.Remarks); command.Parameters.Add("prodnotes", webOrder.ProdNotes); command.Parameters.Add("session_id", webOrder.SessionId); command.Parameters.Add("last_updated", webOrder.LastUpdated); command.Parameters.Add("replicated", webOrder.Replicated); IDatabaseFactory dbFactory = new DatabaseFactory(); IDatabase dbObject = dbFactory.CreateDatabaseInstance(ACTIVE_DATABASE); dbObject.ExecuteQuery(command); query = SQLClass.MAX_ORDER_ID; command = new NpgsqlCommand(query); DataTable dt = new DataTable(); dt = dbObject.GetDataTable(command); OrderId = int.Parse(dt.Rows[0][0].ToString()); } catch (Exception ex) { Hey.Common.Utils.LogWriter.Log(ex.Message); } return(OrderId); }
private int UpdateOrderForCollect(string OrderId, DateTime DeliveryDate, string ShippingMethod) { WebOrders wsOrder = new WebOrders(); wsOrder.OrderID = int.Parse(OrderId); wsOrder.DeliveryDate = DeliveryDate; wsOrder.ShippingMethod = ShippingMethod; int upItem = new FacadeManager().UpdateOrderforCollect(wsOrder); return(upItem); }
private int UpdateWSOrder(string OrderCode, string OrderDesc, string ProdNotes, double TotalOrderWithVat, double TotalOrder) { WebOrders wsOrder = new WebOrders(); wsOrder.OrderCode = OrderCode; wsOrder.OrderDescription = OrderDesc; wsOrder.ProdNotes = ProdNotes; wsOrder.TotalOrderWithVat = TotalOrderWithVat; wsOrder.TotalOrder = TotalOrder; int OrderId = new FacadeManager().UpdateAdditionalInfo(wsOrder); return(OrderId); }
//public void scriptPrint() //{ // window.execScript("report_back('Printing complete!')", "JScript"); //} private int InsertWSOrder(string OrderCode, string CustCode, string OrderStatus, string SessionId) { WebOrders wsOrder = new WebOrders(); wsOrder.OrderCode = OrderCode; wsOrder.CustCode = CustCode; wsOrder.OrderStatus = OrderStatus; wsOrder.SessionId = SessionId; wsOrder.DeliveryDate = DateTime.Now; wsOrder.OrderDate = DateTime.Now; int OrderId = new FacadeManager().InsertShoppingOrder(wsOrder); return(OrderId); }
private int UpdateOrderForDelivery(string OrderId, DateTime DeliveryDate, string ShippingMethod, string CustName, string CustContact, string DeliveryAddress, string DeliveryZipCode, string DeliveryCity, string DeliveryCountry) { WebOrders wsOrder = new WebOrders(); wsOrder.OrderID = int.Parse(OrderId); wsOrder.DeliveryDate = DeliveryDate; wsOrder.ShippingMethod = ShippingMethod; wsOrder.CustName = CustName; wsOrder.CustContact = CustContact; wsOrder.DeliveryAddress = DeliveryAddress; wsOrder.DeliveryZipcode = DeliveryZipCode; wsOrder.DeliveryCity = DeliveryCity; wsOrder.DeliveryCountry = DeliveryCountry; int upItem = new FacadeManager().UpdateOrderforDelivery(wsOrder); return(upItem); }
protected void btnLogin_Click(object sender, EventArgs e) { try { HCustomers CustomerObject = new HCustomers(); CustomerObject = new FacadeManager().GetCustomerInfoByLogin(txtUserName.Text.Trim(), txtPassword.Text.Trim()); if (CustomerObject != null) { lblMsg.Visible = false; RefreshLoginControl(); Session.Add("userrole", CustomerObject); // update ws_order table if order_id exists... if (!String.IsNullOrEmpty(OrderID)) { WebOrders wsOrder = new WebOrders(); wsOrder.OrderID = int.Parse(OrderID); wsOrder.CustCode = CustomerObject.RelCode; wsOrder.SessionId = CustomerObject.Email; if (CustomerObject.RelCode.Length > 4) { wsOrder.OrderCode = CustomerObject.RelCode.Substring(0, 4) + DateTime.Now.Date.ToString("yyMMdd"); } else { wsOrder.OrderCode = CustomerObject.RelCode + DateTime.Now.Date.ToString("yyMMdd"); } int update = new FacadeManager().UpdateWSOrder(wsOrder); } Response.Redirect("Shipping.aspx"); } else { lblMsg.Visible = true; lblMsg.Text = "Gebruikersnaamen/of wachtwoord is onjuist."; } } catch (Exception ex) {} }
public static int UpdateOrderforCollect(WebOrders wsOrder) { int isUpdate = 0; try { string query = SQLClass.UPDATE_ORDER_FOR_COLLECT; NpgsqlCommand command = new NpgsqlCommand(query); command.CommandType = CommandType.Text; command.Parameters.Add("order_id", wsOrder.OrderID); command.Parameters.Add("shipping_method", wsOrder.ShippingMethod); command.Parameters.Add("delivery_date", wsOrder.DeliveryDate); IDatabaseFactory dbFactory = new DatabaseFactory(); IDatabase dbObject = dbFactory.CreateDatabaseInstance(ACTIVE_DATABASE); isUpdate = dbObject.ExecuteQuery(command); } catch (Exception ex) { Hey.Common.Utils.LogWriter.Log(ex.Message); } return(isUpdate); }
public static int UpdateWSOrder(WebOrders wsOrder) { int isUpdate = 0; try { string query = SQLClass.WSHOP_ORDER_UPDATE; NpgsqlCommand command = new NpgsqlCommand(query); command.CommandType = CommandType.Text; command.Parameters.Add("order_id", wsOrder.OrderID); command.Parameters.Add("session_id", wsOrder.SessionId); command.Parameters.Add("order_code", wsOrder.OrderCode); command.Parameters.Add("cust_code", wsOrder.CustCode); IDatabaseFactory dbFactory = new DatabaseFactory(); IDatabase dbObject = dbFactory.CreateDatabaseInstance(ACTIVE_DATABASE); isUpdate = dbObject.ExecuteQuery(command); } catch (Exception ex) { Hey.Common.Utils.LogWriter.Log(ex.Message); } return(isUpdate); }
public int InsertShoppingOrder(WebOrders webOrder) { return(BusinessObjectManager.InsertShoppingOrder(webOrder)); }
public int UpdateAdditionalInfo(WebOrders wsOrder) { return(BusinessObjectManager.UpdateAdditionalInfo(wsOrder)); }
public int UpdateWSOrder(WebOrders wsOrder) { return(BusinessObjectManager.UpdateWSOrder(wsOrder)); }
public int UpdateOrderforDelivery(WebOrders wsOrder) { return(BusinessObjectManager.UpdateOrderforDelivery(wsOrder)); }
public int UpdateOrderforCollect(WebOrders wsOrder) { return(BusinessObjectManager.UpdateOrderforCollect(wsOrder)); }