protected void imgbtndetails_OnClick(object sender, ImageClickEventArgs e)
        {
            PopUP.Visible = true;
            ImageButton btndetails = (ImageButton)sender;

            //GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer;
            Obout.Grid.TemplateContainer gvrow = (Obout.Grid.TemplateContainer)btndetails.NamingContainer;

            hdnprodID.Value = btndetails.ToolTip.ToString();

            CustomProfile        profile       = CustomProfile.GetProfile();
            iProductMasterClient productClient = new iProductMasterClient();
            GetProductDetail     obj           = new GetProductDetail();

            obj = productClient.GetProductDetailByProductID(Convert.ToInt64(hdnprodID.Value), profile.DBConnection._constr);
            productClient.Close();
            if (obj.Installable == Convert.ToBoolean(0))
            {
                this.ModelPopUp.Hide();
                //WebMsgBox.MsgBox.Show("Not Allowed");
                ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "showAlert('Not Allowed!', 'Error', '#');", true);
            }
            else
            {
                if (obj.ProductTypeID != null)
                {
                    ddlProductType.SelectedIndex = ddlProductType.Items.IndexOf(ddlProductType.Items.FindByValue(obj.ProductTypeID.Value.ToString()));
                }

                if (obj.ProductCategoryID != null)
                {
                    ddlCategory.SelectedIndex = ddlCategory.Items.IndexOf(ddlCategory.Items.FindByValue(obj.ProductCategoryID.Value.ToString()));
                }
                BindProductSubCategory();
                if (obj.ProductSubCategoryID != null)
                {
                    ddlSubCategory.SelectedIndex = ddlSubCategory.Items.IndexOf(ddlSubCategory.Items.FindByValue(obj.ProductSubCategoryID.Value.ToString()));
                }
                if (obj.ProductCode != null)
                {
                    txtProductCode.Text = obj.ProductCode.ToString();
                }
                if (obj.Name != null)
                {
                    txtProductName.Text = obj.Name.ToString();
                }
                if (obj.UOMID != null)
                {
                    ddlUOM.SelectedIndex = ddlUOM.Items.IndexOf(ddlUOM.Items.FindByValue(obj.UOMID.Value.ToString()));
                }
                if (obj.PrincipalPrice != null)
                {
                    txtPrincipalPrice.Text = obj.PrincipalPrice.ToString();
                }
                if (obj.Description != null)
                {
                    txtPrdDesc.Text = obj.Description.ToString();
                }

                this.ModelPopUp.Show();
            }
        }
Пример #2
0
        /*End*/
        #endregion

        #region Product Info

        protected void GetProductDetailByProductID()
        {
            CustomProfile        profile       = CustomProfile.GetProfile();
            iProductMasterClient productClient = new iProductMasterClient();
            GetProductDetail     obj           = new GetProductDetail();

            obj = productClient.GetProductDetailByProductID(Convert.ToInt64(hdnprodID.Value), profile.DBConnection._constr);
            productClient.Close();

            if (obj.ProductTypeID != null)
            {
                ddlProductType.SelectedIndex = ddlProductType.Items.IndexOf(ddlProductType.Items.FindByValue(obj.ProductTypeID.Value.ToString()));
            }

            if (obj.ProductCategoryID != null)
            {
                ddlCategory.SelectedIndex = ddlCategory.Items.IndexOf(ddlCategory.Items.FindByValue(obj.ProductCategoryID.Value.ToString()));
            }
            BindProductSubCategory();
            if (obj.ProductSubCategoryID != null)
            {
                ddlSubCategory.SelectedIndex = ddlSubCategory.Items.IndexOf(ddlSubCategory.Items.FindByValue(obj.ProductSubCategoryID.Value.ToString()));
            }
            if (obj.ProductCode != null)
            {
                txtProductCode.Text = obj.ProductCode.ToString();
            }
            if (obj.Name != null)
            {
                txtProductName.Text = obj.Name.ToString();
            }
            if (obj.UOMID != null)
            {
                ddlUOM.SelectedIndex = ddlUOM.Items.IndexOf(ddlUOM.Items.FindByValue(obj.UOMID.Value.ToString()));
            }
            if (obj.PrincipalPrice != null)
            {
                txtPrincipalPrice.Text = obj.PrincipalPrice.ToString();
            }
            if (obj.FixedDiscount != null)
            {
                txtFixedDisc.Text = obj.FixedDiscount.ToString();
            }
            if (obj.FixedDiscountPercent != null)
            {
                chkboxFixedDiscIsPercent.Checked = Convert.ToBoolean(obj.FixedDiscountPercent);
            }
            if (obj.Installable != null)
            {
                chkProductSpe.Items[0].Selected = Convert.ToBoolean(obj.Installable);
            }
            if (obj.AMC != null)
            {
                chkProductSpe.Items[1].Selected = Convert.ToBoolean(obj.AMC);
            }
            if (obj.WarrantyDays != null)
            {
                txtWarrenyInDays.Text = obj.WarrantyDays.ToString();
            }
            if (obj.GuaranteeDays != null)
            {
                txtGuaranteeInDays.Text = obj.GuaranteeDays.ToString();
            }
            rbtNo.Checked  = false;
            rbtYes.Checked = false;
            if (obj.Active != null)
            {
                if (obj.Active == "N")
                {
                    rbtNo.Checked = true;
                }
                if (obj.Active == "Y")
                {
                    rbtYes.Checked = true;
                }
            }
            GetProductDocumentByProductID();
            GetProductSpecificationDetailByProductID();
            GetProductTaxDetailByProductID();
            GetProductImagesByProductID();
            GVRateHistory();
            FillInventoryGrid();
            //   changePrice1.Attributes.Add("style", "visibility:visible");
        }