protected void Page_Load(object sender, EventArgs e)
        {
            strConnString = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString;
            ProItemDAL prodal = new ProItemDAL(strConnString);

            if (!String.IsNullOrEmpty(Request.QueryString["promoid"]))
            {
                int      promoid      = Int32.Parse(Request.QueryString["promoid"].ToString());
                String   strPromoItem = prodal.getPromoItem(promoid);
                String[] arrPromoItem = strPromoItem.Split(':');
                //Populate Items

                hdnEditPromoItemID.Value = arrPromoItem[0].ToString();
                NewItem.Value            = arrPromoItem[1].ToString();
                NewDefaultQty.Value      = arrPromoItem[2].ToString();

                double cost = Convert.ToDouble(arrPromoItem[3].ToString());
                NewCost.Value = cost.ToString("0.00");
                double shippingcost = Convert.ToDouble(arrPromoItem[4].ToString());
                NewShippingCost.Value = shippingcost.ToString("0.00");

                if (arrPromoItem[5].ToString().Trim().Equals("N"))
                {
                    activechkbox.Checked = true;
                }
                else
                {
                    activechkbox.Checked = false;
                    string strScript = "<script language='javascript'>$(document).ready(function (){$('#activechkbox').toggleCheckedState(true);});</script>";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "PopupCP", strScript, false);
                }
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            connString = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString;
            ProItemDAL promoDAL = new ProItemDAL(connString);
            int        itemID   = Int32.Parse(Request.Form["ItemID"].ToString());
            String     itemname = Request.Form["NewItem"].ToString();
            int        promoqty = Int32.Parse(Request.Form["NewDefaultQty"].ToString());
            //Modififed  28/05/2015 Sumudu Kodikara
            float  PromoPrice   = float.Parse(Request.Form["NewCost"].ToString());
            float  ShippingCost = float.Parse(Request.Form["NewShippingCost"].ToString());
            string ActInact     = Request.Form["ActInact"].ToString();

            string finalActInact = "";

            if (ActInact == "false")
            {
                finalActInact = "N";
            }
            else
            {
                finalActInact = "Y";
            }

            Response.Write(promoDAL.udpatePromotionalitem(itemID, itemname, promoqty, PromoPrice, ShippingCost, finalActInact));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            String strConnectionString = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString;

            CONNSTRING    = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString;
            creditNoteDAL = new CreditNotesDAL(strConnectionString);
            prodal        = new ProItemDAL(strConnectionString);

            if (!String.IsNullOrEmpty(Request.QueryString["ContactID"]))
            {
                CONTACTID = Request.QueryString["ContactID"].ToString();
                String   strCreditNoteContact = creditNoteDAL.FetchContactDetails(Int32.Parse(CONTACTID));
                String[] arrContact           = strCreditNoteContact.Split(':');
                ContactInfo.InnerHtml             = arrContact[0].ToString();
                CompanyInfo.InnerHtml             = arrContact[3].ToString();
                BillingAddress.InnerHtml          = arrContact[1].ToString();
                hdnCreditNoteContactDetails.Value = strCreditNoteContact;
            }
            if (!String.IsNullOrEmpty(Request.QueryString["CompanyID"]))
            {
                COMPNAYID = Request.QueryString["CompanyID"].ToString();
                //Create the Session for the CompanyID
                Session["OpenedCompanyID"] = COMPNAYID;
                ACCOUNT_OWNER_ID.Value     = companydal.getCompanyOwnershipAdminID(COMPNAYID);
                ACCOUNT_OWNER_TXT.Value    = companydal.getCompanyAccountOwner(Int32.Parse(COMPNAYID));
            }

            if (!String.IsNullOrEmpty(Request.QueryString["OrderID"]))
            {
                ORDERID             = Request.QueryString["OrderID"].ToString();
                dtsnumber.InnerText = creditNoteDAL.getXeroOrderNumber(ORDERID);
                hdnEditOrder.Value  = creditNoteDAL.getOrderDetails(ORDERID.ToString());
                String[] arr_Order = creditNoteDAL.getOrderDetails(ORDERID.ToString()).Split(':');
                OrderNumber.InnerHtml   = "Order:" + arr_Order[3].ToString();
                hdnEditOrderItems.Value = creditNoteDAL.getOrderItemsbyOrderId(ORDERID.ToString(), strConnectionString);
                PROCOST.Value           = prodal.getPromotionlCost(Int32.Parse(ORDERID));
                PopulateDropDownList(Int32.Parse(COMPNAYID), Int32.Parse(ORDERID));
                hdnORDERID.Value    = Request.QueryString["OrderID"].ToString();
                COMMISH_SPLIT.Value = orddal.getCommishSplitBoolean(Int32.Parse(Request.QueryString["OrderID"].ToString()));

                SALESPERON_ID.Value = orddal.getSalespersonByID(Int32.Parse(Request.QueryString["OrderID"].ToString()));

                SALESPERSON_TXT.Value = orddal.getSalespersonName(Int32.Parse(Request.QueryString["OrderID"].ToString()));
            }
        }