protected void loadProductDDL()
        {
            if (Request.QueryString["promotionid"] != null)
            {
                int promotionid = int.Parse(Request.QueryString["promotionid"]);
                var promotion   = ClientManager.getPromotion(promotionid);

                var x = ClientManager.getAllProductsByClientId(promotion.clientid);
                ProductDDL.DataSource     = x;
                ProductDDL.DataTextField  = "name";
                ProductDDL.DataValueField = "productid";
                ProductDDL.DataBind();
            }
        }
Exemple #2
0
 protected void CategoryDDL_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (CategoryDDL.SelectedIndex == 0)
     {
         ProductDDL.SelectedIndex = 0;
         //ProductDDL.Enabled = false;
         CategoryDDL.DataBind();
         ProductDDL.DataBind();
     }
     else
     {
         ProductDDL.Enabled = true;
     }
 }
        protected void loadRedemptionByPointReceipt(int redemptionbypointreceiptid)
        {
            var redemptionByProductReceipt = ClientManager.getRedemptionByPointReceipt(redemptionbypointreceiptid);

            ReceiptIdLit.Text = redemptionbypointreceiptid.ToString();
            var client = ClientManager.getClient(redemptionByProductReceipt.clientid);

            ClientNameLbl.Text = client.name;
            MembershipUser member = Membership.GetUser(redemptionByProductReceipt.UserId);

            UseridLit.Text = member.UserName;
            // int resellerIndex= ResellerDDL2.FindItemIndexByValue(redemptionbypointreceipt.resellerid.ToString());
            ResellerDDL2.SelectedValue             = redemptionByProductReceipt.resellerid.ToString();
            InvoiceNoTB.Text                       = redemptionByProductReceipt.invoiceno;              //todo
            PurchaseDateRadDatePicker.SelectedDate = redemptionByProductReceipt.purchasedate;           //todo
            totalpointsLit.Text                    = redemptionByProductReceipt.totalpoints.ToString(); //todo


            ReceiptHL.NavigateUrl = Config.UploadInvoiceRelativePath + redemptionByProductReceipt.receiptpath;

            bool canEdit;

            if ((redemptionByProductReceipt.status == (int)RedemptionByPointReceiptState.PROCESSED) ||
                (redemptionByProductReceipt.status == (int)RedemptionByPointReceiptState.DUPLICATE) ||
                (redemptionByProductReceipt.status == (int)RedemptionByPointReceiptState.REJECTED) ||
                (redemptionByProductReceipt.status == (int)RedemptionByPointReceiptState.VOID))
            {
                canEdit = false;


                //UpdateReceiptBut.Visible = false;
                //AddItemBut.Visible = false;
            }
            else
            {
                canEdit = true;
                //UpdateReceiptBut.Visible = true;
                //AddItemBut.Visible = true;
            }
            if ((redemptionByProductReceipt.status == (int)RedemptionByPointReceiptState.PROCESSED))
            {
                if (Roles.IsUserInRole("Admin"))
                {
                    VoidBut.Visible = true;
                }
                else
                {
                    VoidBut.Visible = false;
                }
            }
            else
            {
                VoidBut.Visible = false;
            }

            InvoiceNoTB.Enabled               = canEdit;
            CustomPointsTB.Enabled            = canEdit;
            ResellerDDL2.Enabled              = canEdit;
            PurchaseDateRadDatePicker.Enabled = canEdit;
            UpdateReceiptBut.Enabled          = canEdit;
            RedemptionDetailsEditPnl.Visible  = canEdit;
            serialnoTB.Text      = "";
            DuplicateBut.Enabled = canEdit;
            RejectBut.Enabled    = canEdit;

            var x = ClientManager.getAllRedemptionByPointReceiptReceiptId(redemptionbypointreceiptid);

            ReceiptItemRadGrid.DataSource = x;
            ReceiptItemRadGrid.Rebind();

            //load productddl
            var y = ClientManager.getAllProductsByClientId(redemptionByProductReceipt.clientid);

            ProductDDL.DataTextField  = "model";
            ProductDDL.DataValueField = "productid";
            ProductDDL.DataSource     = y;

            ProductDDL.DataBind();
            ProductDDL.Items.Insert(0, new RadComboBoxItem("-select-", string.Empty));

            AddItemBut.CommandArgument       = redemptionbypointreceiptid.ToString();
            UpdateReceiptBut.CommandArgument = redemptionbypointreceiptid.ToString();
        }