示例#1
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        try
        {
            string        cust_ref = txtCustRefCode.Text;
            string        remarks  = txtOrderRemark.Text;
            FacadeManager facade   = new FacadeManager();
            if (ViewState["OrderID"] != null)
            {
                facade.UpdateShopOrderData(ViewState["OrderID"].ToString(), cust_ref, remarks);
            }

            if (Session["userrole"] == null)  // if user is anonymous i.e. webshoprole = 0
            {
                Response.Redirect("WebShopAccount.aspx");
            }
            else
            {
                Response.Redirect("Shipping.aspx");
            }
        }
        catch (Exception ex)
        {
        }
    }
示例#2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["usersession"];

        if (cookie != null)
        {
            sessionid = cookie.Value.ToString();
            DataTable dt = new DataTable();
            dt = new FacadeManager().CheckOrderExist(sessionid); // step 1: if any order exists for this anonymous user
            if (dt.Rows.Count > 0)                               // step 2: if order exists, get the order id and total item number for this anonymous user
            {
                int OrderID = int.Parse(dt.Rows[0]["order_id"].ToString());
                if (Session["orderid"] == null)
                {
                    Session.Add("orderid", OrderID.ToString());
                }
                int TotalItem = new FacadeManager().TotalItemofOrder(OrderID);
                if (TotalItem > 0)
                {
                    if (Session["itemno"] == null)
                    {
                        Session.Add("itemno", TotalItem.ToString());
                    }
                }
            }
        }
    }
示例#3
0
    public List <MaterialGroup> GetGroupItems()
    {
        List <MaterialGroup> groupList = new List <MaterialGroup>();

        groupList = new FacadeManager().GetMenuItems();
        return(groupList);
    }
示例#4
0
 protected void btnAddSpecialItem_Click(object sender, EventArgs e)
 {
     try
     {
         string ItemID = string.Empty;
         if (gvSpCart.Rows.Count > 0)
         {
             ItemID = gvSpCart.DataKeys[0].Values[1].ToString();
         }
         if (gvShoppingSpecial.Rows.Count > 0)
         {
             ItemID = gvShoppingSpecial.DataKeys[0].Values[1].ToString();
         }
         if (ItemID != string.Empty)
         {
             FacadeManager facade   = new FacadeManager();
             IShoppingCart cartItem = facade.GetACartItem(ItemID);
             if (cartItem != null)
             {
                 txtAddSpDescription.Text = cartItem.Description;
                 mpeAddSpecialItem.Show();
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
示例#5
0
    protected void SaveItem_Click(object sender, EventArgs e)
    {
        try
        {
            FacadeManager facade   = new FacadeManager();
            IShoppingCart cartItem = new ShoppingCartManager();
            cartItem.ItemID       = hdnItemID.Value;
            cartItem.ItemCode     = txtStdMatCode.Text;
            cartItem.Description  = txtStdDescription.Text;
            cartItem.Quantity     = txtStdQuantiry.Text.Replace(",", ".");
            cartItem.Remark       = txtStdRemark.Text;
            cartItem.ProductNotes = txtStdProdNote.Text;
            facade.UpdateShoppingCartItem(cartItem);
            EditingGrid currentGrid = (EditingGrid)Enum.Parse(typeof(EditingGrid), hdnCurrentGrid.Value);
            if (EditingGrid.SPECIAL == currentGrid)
            {
                FillShoppingCartSpecialData();
            }
            else
            {
                FillShoppingCartStandardData();
            }


            PopulateOrderDetail();
            udpShoppingCart.Update();
            mpeStandardItem.Hide();
        }
        catch (Exception ex)
        {
        }
    }
示例#6
0
    protected void btnEditInfo_Click(object sender, EventArgs e)
    {
        try
        {
            BindCustomerCombo();
            HCustomers hUser   = new HCustomers();
            string     PrjCode = string.Empty;
            hUser = (HCustomers)Session["userrole"];
            if (hUser.RelCode.Length > 4)
            {
                PrjCode = "KLSP" + hUser.RelCode.Substring(0, 4) + DateTime.Now.Date.ToString("yyMMdd");
            }
            else
            {
                PrjCode = "KLSP" + hUser.RelCode + DateTime.Now.Date.ToString("yyMMdd");
            }
            DataTable orderDT = new DataTable();
            orderDT = new FacadeManager().CheckREGOrADMOrderExist(hUser.RelCode);
            int    OrderID    = int.Parse(orderDT.Rows[0]["order_id"].ToString());
            double TotalPrice = double.Parse(orderDT.Rows[0]["total_order_with_vat"].ToString());
            txtAddInfoTotalPrc.Text = TotalPrice.ToString("#0,0.00", CultureInfo.CreateSpecificCulture("nl-NL"));
            txtAddInfoPrjCode.Text  = drpKlant.SelectedValue;

            //hdnInfoShipCost.Value = orderDT.Rows[0]["shipping_cost"].ToString();
            //hdnInfoTotalItems.Value = orderDT.Rows[0]["total_items"].ToString();
            //hdnInfoDiscountItems.Value = orderDT.Rows[0]["discount_items"].ToString();

            OrderIdSession(OrderID.ToString()); // orderid put in session
            mpeEditInfo.Show();
        }
        catch (Exception ex)
        {
        }
    }
示例#7
0
    protected void btnSpecialGridItemEdit_Click(object sender, EventArgs e)
    {
        try
        {
            ImageButton btnImage = sender as ImageButton;
            int         index    = btnImage.CommandArgument != "" ? Convert.ToInt32(btnImage.CommandArgument) : -1;
            string      ItemID   = gvShoppingSpecial.DataKeys[index].Values[1].ToString();
            if (ItemID != string.Empty)
            {
                FacadeManager facade   = new FacadeManager();
                IShoppingCart cartItem = facade.GetACartItem(ItemID);
                if (cartItem != null)
                {
                    txtVan.Text = cartItem.ItemType.ToLower() == "c" ? cartItem.ItemCode : string.Empty;
                    txtItemDescCustomise.Text = cartItem.Description;
                    txtQuanityCustomise.Text  = Convert.ToDouble(cartItem.Quantity).ToString("#0,0.00", CultureInfo.CreateSpecificCulture("nl-NL"));
                    txtSellPrice.Text         = Convert.ToDouble(cartItem.PriceSell).ToString("#0,0.00", CultureInfo.CreateSpecificCulture("nl-NL"));
                    txtCostPrice.Text         = Convert.ToDouble(cartItem.PriceCost).ToString("#0,0.00", CultureInfo.CreateSpecificCulture("nl-NL"));
                    txtUnit.Text = cartItem.Unit;
                    lblTotalQuantityCustomise.Text = " / " + txtQuanityCustomise.Text;
                    txtRemarkCustomise.Text        = cartItem.Remark;
                    txtProdNodesCustomise.Text     = cartItem.ProductNotes;
                    chkToEdm.Checked     = cartItem.ToEdm == "0" ? false : true;
                    chkToProduct.Checked = cartItem.ToProduct == "0" ? false : true;

                    hdnItemIDCustomise.Value      = ItemID;
                    hdnCurrentGridforCustom.Value = EditingGrid.SPECIAL.ToString();
                    mpeSpecialItem.Show();
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
示例#8
0
 protected void lnkForgetPassword_Click(object sender, EventArgs e)
 {
     try
     {
         if (!String.IsNullOrEmpty(txtUserName.Text))
         {
             EmailInfo eInfo = new EmailInfo();
             eInfo.Email    = txtUserName.Text.Trim();
             lblMsg.Visible = false;
             bool success = new FacadeManager().SendPasswordRecoveryMail(eInfo);
             if (success)
             {
                 lblMsg.Visible = true;
                 lblMsg.Text    = "Uw wachtwoord is verstuurd naar het opgegeven e-mailadres.";
             }
             else
             {
                 lblMsg.Visible = true;
                 lblMsg.Text    = "Het opgegeven e-mailadres is onbekend in ons systeem.";
             }
         }
         else
         {
             lblMsg.Visible = true;
             lblMsg.Text    = "Het opgegeven e-mailadres is onbekend in ons systeem.";
         }
     }
     catch (Exception ex)
     { }
 }
    public void BindGrid()
    {
        string ItemCode    = Request.QueryString["code"];
        string fieldNames  = string.Empty;
        string fieldValues = string.Empty;

        foreach (Control c in ComboPanel.Controls)
        {
            if (c.GetType() == typeof(DropDownList))
            {
                if (((DropDownList)c).SelectedValue != "")
                {
                    fieldNames  += ((DropDownList)c).ID + ",";
                    fieldValues += ((DropDownList)c).SelectedValue + ",";
                }
            }
        }

        if (!String.IsNullOrEmpty(fieldNames))
        {
            fieldNames = fieldNames.Remove(fieldNames.LastIndexOf(','), 1);
        }
        if (!String.IsNullOrEmpty(fieldValues))
        {
            fieldValues = fieldValues.Remove(fieldValues.LastIndexOf(','), 1);
        }

        List <BaseMaterial> bmObject = new FacadeManager().GetFilterData(ItemCode, fieldNames, fieldValues);

        ResultPane.Attributes.Add("class", "resultpane");
        ResultPane.Visible  = true;
        gvResult.DataSource = bmObject;
        gvResult.DataBind();
        OrganizeGridColumn();
    }
示例#10
0
 protected void btnNaarProd_Click(object sender, EventArgs e)
 {
     try
     {
         ShoppingCartManager cart   = new ShoppingCartManager();
         FacadeManager       facade = new FacadeManager();
         if (Session["orderid"] != null)
         {
             cart.OrderID = Session["orderid"].ToString();
             HCustomers hUser = (HCustomers)Session["userrole"];
             if (ViewState[userType] != null && hUser != null)
             {
                 facade.ConfirmOrder(cart, "P");
                 // insert toedm and basematerial
                 int       IsEDM          = 0;
                 int       IsBaseMaterial = 0;
                 DataTable ItemTable      = new DataTable();
                 ItemTable = new FacadeManager().GetAllItemForOrder(int.Parse(cart.OrderID));
                 if (ItemTable.Rows.Count > 0)
                 {
                     foreach (DataRow row in ItemTable.Rows)
                     {
                         IsEDM = Convert.ToInt32(row["to_edm"].ToString());
                         if (IsEDM == 1)
                         {
                             // insert EDM
                             int res = InsertEDMData(hUser);
                         }
                         IsBaseMaterial = Convert.ToInt32(row["to_products"].ToString());
                         if (IsBaseMaterial == 1)
                         {
                             // insert into BaseMaterial
                             int res = InsertBaseMaterialData(hUser);
                         }
                     }
                 }
                 if (chkConfirmation.Checked) // if confirmation checkbox selected then send Order Finalize mail to customer.
                 {
                     string    orderid  = Session["orderid"] != null ? Session["orderid"].ToString() : "Order ID Could not retrieve";
                     string    heyEmail = ConfigurationManager.AppSettings["hey-admin-mail"];
                     EmailInfo eInfo    = new EmailInfo();
                     eInfo.Email = hUser.Email;
                     string msg = "Product purchase order finalized.<br /> Order ID : " + orderid +
                                  "<br/> Total Amount: " + lblTotal.Text +
                                  "<br/> Product Discount: " + lblProductDiscout.Text +
                                  "<br/> Other Discount: " + lblOtherDiscount.Text +
                                  "<br/> Shipping Cost: " + lblShippingCost.Text +
                                  "<br/> Total Amount (Including vat): " + lblTotalIncludingVat.Text +
                                  "<br/><br/> With kind regards,<br/><a href='new.hey-ermelo.nl'>HEY</a>";
                     bool success = new FacadeManager().OrderFinalizeMailToCustomer(eInfo, heyEmail, msg);
                 }
                 ManageSession();
                 Response.Redirect("Home.aspx");
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
示例#11
0
 void PopulateOrderDetail()
 {
     if (Session["orderid"] != null)
     {
         FacadeManager facade = new FacadeManager();
         DataTable     dt     = facade.ShopOrderCostDetail(Session["orderid"].ToString());
         try
         {
             if (dt.Rows.Count > 0)
             {
                 if (ViewState[userType] != null && (UserType)ViewState[userType] == UserType.ANONYMOUS)
                 {
                     costdetailContainer.Visible = false;
                 }
                 else
                 {
                     lblTotal.Text             = Convert.ToDouble(dt.Rows[0]["total_order"]).ToString("#0,0.00", CultureInfo.CreateSpecificCulture("nl-NL"));
                     lblProductDiscout.Text    = Convert.ToDouble(dt.Rows[0]["discount"]).ToString("#0,0.00", CultureInfo.CreateSpecificCulture("nl-NL"));
                     lblOtherDiscount.Text     = Convert.ToDouble(dt.Rows[0]["other_discount"]).ToString("#0,0.00", CultureInfo.CreateSpecificCulture("nl-NL"));
                     lblShippingCost.Text      = Convert.ToDouble(dt.Rows[0]["shipping_cost"]).ToString("#0,0.00", CultureInfo.CreateSpecificCulture("nl-NL"));
                     lblTotalVat.Text          = Convert.ToDouble(dt.Rows[0]["total_vat"]).ToString("#0,0.00", CultureInfo.CreateSpecificCulture("nl-NL"));
                     lblTotalIncludingVat.Text = Convert.ToDouble(dt.Rows[0]["total_order_with_vat"]).ToString("#0,0.00", CultureInfo.CreateSpecificCulture("nl-NL"));
                 }
                 txtCustRefCode.Text = dt.Rows[0]["cust_ref"].ToString();
                 txtOrderRemark.Text = dt.Rows[0]["remarks"].ToString();
             }
         }
         catch
         {
         }
     }
 }
示例#12
0
    void GetFileList()
    {
        try
        {
            FacadeManager       facade    = new FacadeManager();
            List <UploadedFile> uFileList = new List <UploadedFile>();
            if (ViewState["OrderID"] != null)
            {
                uFileList = facade.GetUploadedFiles(ViewState["OrderID"].ToString());
            }
            if (uFileList.Count > 0)
            {
                gvFiles.DataSource = uFileList;
                gvFiles.DataBind();
            }
            else
            {
                uFileList.Add(new UploadedFile());
                gvFiles.DataSource = uFileList;
                gvFiles.DataBind();

                int colCount = gvFiles.Columns.Count;
                gvFiles.Rows[0].Cells.Clear();
                gvFiles.Rows[0].Cells.Add(new TableCell());
                gvFiles.Rows[0].Cells[0].ColumnSpan = colCount;
                gvFiles.Rows[0].Cells[0].Text       = gvFiles.EmptyDataText;
            }
        }
        catch (Exception ex)
        {
        }
    }
示例#13
0
 protected void btnPlaceOffer_Click(object sender, EventArgs e)
 {
     try
     {
         ShoppingCartManager cart   = new ShoppingCartManager();
         FacadeManager       facade = new FacadeManager();
         if (Session["orderid"] != null)
         {
             cart.OrderID = Session["orderid"].ToString();
             facade.ConfirmOrder(cart, "B");
             HCustomers hUser = (HCustomers)Session["userrole"];
             if (hUser != null)
             {
                 string orderid  = Session["orderid"] != null ? Session["orderid"].ToString() : "Order ID Could not retrieve";
                 string heyEmail = ConfigurationManager.AppSettings["hey-admin-mail"];
                 string msg      = "Product purchase order submitted.<br /> Order ID : " + orderid + "<br/> Total Amount: " + lblTotal.Text +
                                   "<br/><br/> With kind regards,<br/>" + hUser.Email;;
                 EmailInfo eInfo = new EmailInfo();
                 eInfo.Email = hUser.Email;
                 bool success = new FacadeManager().OrderConfirmationMailToAdmin(eInfo, heyEmail, msg);
             }
             ManageSession();
             Response.Redirect("Home.aspx");
         }
     }
     catch (Exception ex)
     {
     }
 }
示例#14
0
 protected void btnStandardGridItemEdit_Click(object sender, EventArgs e)
 {
     try
     {
         ImageButton btnImage = sender as ImageButton;
         int         index    = btnImage.CommandArgument != "" ? Convert.ToInt32(btnImage.CommandArgument) : -1;
         string      ItemID   = gvSpCart.DataKeys[index].Values[1].ToString();
         if (ItemID != string.Empty)
         {
             FacadeManager facade   = new FacadeManager();
             IShoppingCart cartItem = facade.GetACartItem(ItemID);
             if (cartItem != null)
             {
                 txtStdMatCode.Text     = cartItem.ItemCode;
                 txtStdDescription.Text = cartItem.Description;
                 txtStdQuantiry.Text    = Convert.ToDouble(cartItem.Quantity).ToString("#0,0.00", CultureInfo.CreateSpecificCulture("nl-NL"));
                 txtStdRemark.Text      = cartItem.Remark;
                 txtStdProdNote.Text    = cartItem.ProductNotes;
                 hdnItemID.Value        = ItemID;
                 hdnCurrentGrid.Value   = EditingGrid.STANDARD.ToString();
                 mpeStandardItem.Show();
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
示例#15
0
    private void FillShoppingCartSpecialData()
    {
        try
        {
            FacadeManager        facade = new FacadeManager();
            List <IShoppingCart> sCart  = new List <IShoppingCart>();
            sCart = facade.GetShoppingCart(sessionid, ItemTypeEnum.SPECIAL, UserType.ADMIN);
            if (sCart.Count > 0)
            {
                gvShoppingSpecial.DataSource = sCart;
                gvShoppingSpecial.DataBind();
            }
            else
            {
                sCart.Add(new ShoppingCartManager());
                gvShoppingSpecial.DataSource = sCart;
                gvShoppingSpecial.DataBind();

                int colCount = gvShoppingSpecial.Columns.Count;
                gvShoppingSpecial.Rows[0].Cells.Clear();
                gvShoppingSpecial.Rows[0].Cells.Add(new TableCell());
                gvShoppingSpecial.Rows[0].Cells[0].ColumnSpan = colCount;
                gvShoppingSpecial.Rows[0].Cells[0].Text       = gvShoppingSpecial.EmptyDataText;
            }
        }
        catch (Exception ex)
        {
        }
    }
示例#16
0
    public void BindSearchGrid()
    {
        string ItemCode        = Request.QueryString["code"];
        string ItemDescription = Request.QueryString["description"];

        List <BaseMaterial> bmObject = new FacadeManager().GetSubgroupFilterSearchData(ItemCode);

        ResultPane.Attributes.Add("class", "resultpane");
        ResultPane.Visible  = true;
        gvResult.DataSource = bmObject;
        gvResult.DataBind();
        OrganizeGridColumn();

        //List<MaterialGroup> listObj = (List<MaterialGroup>)Session["SearchResultSet"];
        //foreach (MaterialGroup group in listObj)
        //{
        //    if (ItemCode.Equals(group.Code))
        //    {
        //        ResultPane.Visible = true;
        //        ClearGrid();
        //        gvResult.DataSource = group.MaterialGroups;
        //        gvResult.DataBind();
        //    }
        //}
    }
示例#17
0
    private double GetDiscountValueForCustomer(HCustomers hUser, string SubItem)
    {
        double    Discount = 0.0;
        DataTable dt       = new DataTable();

        dt = new FacadeManager().GetDiscountForCustomer(hUser.RelCode); // step 1.
        if (dt.Rows.Count > 0)
        {
            DataRow[] drows = dt.Select(" prod_code='" + SubItem.ToUpper() + "'");
            if (drows.Length == 0)
            {
                drows = dt.Select(" prod_code='" + hUser.RelCode.ToUpper() + "'");
            }
            if (drows.Length == 0)
            {
                drows = dt.Select(" prod_code='" + hUser.RelCode.Substring(0, 1).ToUpper() + "'");
            }
            if (drows.Length == 0)
            {
                drows = dt.Select(" prod_code='*' ");
            }
            if (drows.Length > 0)
            {
                foreach (DataRow dr in drows)
                {
                    Discount = double.Parse(dr["discount"].ToString());
                }
            }
        }
        return(Discount);
    }
示例#18
0
    public void LoadNavigationContainer()
    {
        List <MaterialGroup> itemGroups = new List <MaterialGroup>();

        itemGroups = new FacadeManager().GetMenuItems();

        foreach (MaterialGroup item in itemGroups)
        {
            AjaxControlToolkit.AccordionPane pane = new AjaxControlToolkit.AccordionPane();
            //create unique pane id...
            pane.ID = "Pane_" + item.Code;
            //pane.CssClass = "MenuHeaderDiv";
            // pane Header section ...
            HyperLink headerLink = new HyperLink();
            headerLink.Text     = item.Description;
            headerLink.CssClass = "MenuHeader";
            HtmlGenericControl img = new HtmlGenericControl("img");
            img.Attributes["src"]   = "images/menu_arrow.png";
            img.Attributes["class"] = "imgposition";

            pane.HeaderContainer.CssClass = "MenuHeaderDiv";
            pane.HeaderCssClass           = "MenuHeaderDiv";

            pane.HeaderContainer.Controls.Add(headerLink);
            pane.HeaderContainer.Controls.Add(img);


            //creating list of children...
            if (item.ChildGroupItems.Count > 1)
            {
                // Pane Content section...
                HtmlGenericControl list;
                int i = 0;
                foreach (MaterialGroup mg in item.ChildGroupItems)
                {
                    i++;
                    list = new HtmlGenericControl("li");
                    LinkButton linkBtn = new LinkButton();
                    linkBtn.ID = i + "_" + mg.Code;
                    linkBtn.Attributes["runat"] = "server";
                    linkBtn.Text            = mg.Description;
                    linkBtn.CommandArgument = mg.Code + "," + mg.Description;
                    linkBtn.CommandName     = "GetItemCode";
                    linkBtn.CssClass        = "MenuList";
                    linkBtn.Click          += new EventHandler(linkBtn_Click);

                    list.Controls.Add(linkBtn);
                    pane.ContentCssClass = "MenuList";
                    pane.ContentContainer.Controls.Add(list);
                }
            }
            accordMenu.Panes.Add(pane);
        }
    }
示例#19
0
    public void BindCountryCombo()
    {
        DataTable dt = new DataTable();

        dt = new FacadeManager().GetCountryList();
        drpCountry.DataSource     = dt;
        drpCountry.DataTextField  = dt.Columns[0].ToString();
        drpCountry.DataValueField = dt.Columns[0].ToString();
        drpCountry.DataBind();
        drpCountry.Items.Insert(0, new ListItem("Default Country"));
    }
示例#20
0
    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);
    }
示例#21
0
    public void BindCustomerCombo()
    {
        DataTable dt = new DataTable();

        dt = new FacadeManager().GetAllCustomers();
        drpKlant.DataSource     = dt;
        drpKlant.DataTextField  = dt.Columns[1].ToString();
        drpKlant.DataValueField = dt.Columns[0].ToString();
        drpKlant.DataBind();
        drpKlant.Items.Insert(0, new ListItem("-------------"));
    }
示例#22
0
    private void GetSearchResult()
    {
        string ItemCode = Request.QueryString["code"];
        string input    = txtFilterSearch.Text;
        List <BaseMaterial> bmObject = new FacadeManager().FilterPanelSearchData(ItemCode, input);

        ResultPane.Attributes.Add("class", "resultpane");
        ResultPane.Visible  = true;
        gvResult.DataSource = bmObject;
        gvResult.DataBind();
        OrganizeGridColumn();
    }
示例#23
0
 public void GetSearchResult()
 {
     if (Session["searchstring"] != null)
     {
         SearchResultPane.Visible = true;
         EmptyDiv.Visible         = false;
         string inputString          = Session["searchstring"].ToString();
         List <MaterialGroup> groups = new FacadeManager().GetSearchFilterData(inputString);
         dlProducten.DataSource = groups;
         dlProducten.DataBind();
     }
 }
示例#24
0
    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);
    }
示例#25
0
    public int InsertBaseMaterialData(HCustomers hUser)
    {
        string MatCode     = string.Empty;
        string CustCode    = string.Empty;
        string Description = string.Empty;

        CustCode = GetCustCode(hUser);
        MatCode  = new FacadeManager().GetKLSPCode();
        CustCode = hUser.RelCode;
        int insert = InsertBaseMaterial(MatCode, MatCode, CustCode, Description);

        return(insert);
    }
示例#26
0
    //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);
    }
示例#27
0
    public int InsertBaseMaterial(string Matcode, string EDMCode, string CustCode, string Description)
    {
        BaseMaterial bm = new BaseMaterial();

        bm.Matcode          = Matcode;
        bm.Description      = Description;
        bm.OrderDescription = string.Empty;
        bm.SuppCode         = string.Empty;
        bm.PrjCode          = string.Empty;
        bm.EdmCode          = EDMCode;
        bm.Unit             = string.Empty;
        bm.PackUnit         = string.Empty;
        bm.PurchasePrice    = 0.0;
        bm.Discount1        = 0.0;
        bm.Discount2        = 0.0;
        bm.Freight          = 0.0;
        bm.Addon1           = 0.0;
        bm.Addon2           = 0.0;
        bm.NetPrice         = 0.0;
        bm.SellPrice        = 0.0;
        bm.SellPerfect      = 0.0;
        bm.OrderDate        = DateTime.Now.ToShortDateString();
        bm.DeliveryDate     = DateTime.Now.ToShortDateString();
        bm.InStock          = 0.0;
        bm.MinStock         = 0.0;
        bm.MaxStock         = 0.0;
        bm.MinOrder         = 0.0;
        bm.StockLoc         = string.Empty;
        bm.SparePart        = 0;
        bm.WebShop          = 1;
        bm.Remark           = string.Empty;
        bm.MergeCode        = 1;
        bm.DerivedFrom      = string.Empty;
        bm.RemarkEng        = string.Empty;
        bm.KeyWords         = string.Empty;
        bm.Filter1          = string.Empty;
        bm.Filter2          = string.Empty;
        bm.Filter3          = string.Empty;
        bm.Filter4          = string.Empty;
        bm.Filter5          = string.Empty;
        bm.NewSuppCode      = string.Empty;
        bm.CustCode         = CustCode;
        bm.MatcodeSuppl     = string.Empty;
        bm.Deleted          = 0;

        int item = new FacadeManager().InsertBaseMaterial(bm);

        return(item);
    }
示例#28
0
 protected void UploadFile_Click(object sender, EventArgs e)
 {
     try
     {
         FileUpload    fUpload = gvFiles.FooterRow.FindControl("UploadFile_Click") as FileUpload;
         FacadeManager facade  = new FacadeManager();
         if (ViewState["OrderID"] != null)
         {
             facade.UploadFile(fileUploadsCart, ViewState["OrderID"].ToString());
             GetFileList();
         }
     }
     catch (Exception ex)
     {
     }
 }
示例#29
0
 protected void btnUpload_Click(object sender, EventArgs e)
 {
     try
     {
         FileUpload    fUpload = gvFiles.FooterRow.FindControl("fileUploadsCart") as FileUpload;
         FacadeManager facade  = new FacadeManager();
         if (Session["orderid"] != null)
         {
             facade.UploadFile(fUpload, Session["orderid"].ToString());
             GetFileList();
         }
     }
     catch (Exception ex)
     {
     }
 }
示例#30
0
    private void DoCustomizeItems()
    {
        try
        {
            double totalQuantity     = Convert.ToDouble(lblTotalQuantityCustomise.Text.Replace("/", "").Trim().Replace(",", "."));
            double customisedQuatity = Convert.ToDouble(txtQuanityCustomise.Text.Trim().Replace(",", "."));
            if (customisedQuatity > 0 && ViewState["OrderID"] != null)
            {
                ShoppingCartManager cartItem = new ShoppingCartManager();
                cartItem.ItemID       = hdnItemIDCustomise.Value;
                cartItem.Description  = txtItemDescCustomise.Text.Trim();
                cartItem.Quantity     = customisedQuatity.ToString();
                cartItem.PriceSell    = Convert.ToDouble(txtSellPrice.Text.Replace(",", ".")).ToString();
                cartItem.PriceCost    = Convert.ToDouble(txtCostPrice.Text.Replace(",", ".")).ToString();
                cartItem.Unit         = txtUnit.Text;
                cartItem.Remark       = txtRemarkCustomise.Text.Trim();
                cartItem.ProductNotes = txtProdNodesCustomise.Text.Trim();
                cartItem.ToEdm        = chkToEdm.Checked ? "1" : "0";
                cartItem.ToProduct    = chkToProduct.Checked ? "1" : "0";


                FacadeManager facade  = new FacadeManager();
                string        item_id = facade.CheckCustomItemExists(cartItem);

                if (totalQuantity == customisedQuatity)
                {
                    facade.ConvertItemToCustomized(cartItem);
                }
                else if (customisedQuatity < totalQuantity)
                {
                    facade.CreateNewCustomizedItem(cartItem);

                    facade.ReduceStandardItemQuanity(cartItem);
                }

                FillShoppingCartSpecialData();

                FillShoppingCartStandardData();
                udpShoppingCart.Update();
            }
        }
        catch (Exception ex)
        {
        }
    }