Exemplo n.º 1
0
        public void BindProductDetails(long OrderID, int Sequence, long UserID)
        {
            CustomProfile      profile    = CustomProfile.GetProfile();
            iPartRequestClient objService = new iPartRequestClient();
            int IsPriceEdit = objService.IsPriceEditYN(OrderID, UserID, profile.DBConnection._constr);
            int IsSkuChange = objService.IsSkuChangeYN(OrderID, UserID, profile.DBConnection._constr);

            if (IsPriceEdit == 1)
            {
                txtPrc.Disabled = false;
            }
            else
            {
                txtPrc.Disabled = true;
            }
            if (IsSkuChange == 1)
            {
                txtReqQty.Disabled = false;
            }
            else
            {
                txtReqQty.Disabled = true;
            }

            DataSet ds = new DataSet();

            ds = objService.GetProductOfOrder(OrderID, Sequence, profile.DBConnection._constr);
            txtProductCode.Text        = ds.Tables[0].Rows[0]["Prod_Code"].ToString();
            txtProductName.Text        = ds.Tables[0].Rows[0]["Prod_Name"].ToString();
            txtProductDescription.Text = ds.Tables[0].Rows[0]["Prod_Description"].ToString();
            txtMOQ.Text          = ds.Tables[0].Rows[0]["moq"].ToString();
            txtCurrentStock.Text = ds.Tables[0].Rows[0]["AvailableBalance"].ToString();
            txtReserveStock.Text = ds.Tables[0].Rows[0]["ResurveQty"].ToString();
            //   txtReqQty.Value = ds.Tables[0].Rows[0]["OrderQty"].ToString();
            txtOrderQty.Text = ds.Tables[0].Rows[0]["OrderQty"].ToString();
            txtPrc.Value     = ds.Tables[0].Rows[0]["Price"].ToString();
            //txtPrice.Text = ds.Tables[0].Rows[0]["Price"].ToString();
            txtTotal.Text = ds.Tables[0].Rows[0]["Total"].ToString();
            int     ProdID = int.Parse(ds.Tables[0].Rows[0]["SkuId"].ToString()); hdnSelectedProduct.Value = ProdID.ToString();
            DataSet dsUOM  = new DataSet();

            dsUOM             = objService.GetUOMofSelectedProduct(ProdID, profile.DBConnection._constr);
            ddlUOM.DataSource = dsUOM;
            ddlUOM.DataBind();
            //ddlUOM.SelectedValue =ds.Tables[0].Rows[0]["UOMID"].ToString();
            ddlUOM.SelectedIndex = ddlUOM.Items.IndexOf(ddlUOM.Items.FindByValue(ds.Tables[0].Rows[0]["UOMID"].ToString()));
            DataSet dsUOMSelPrd = new DataSet();

            dsUOMSelPrd = objService.GetUOMofSelectedProduct(ProdID, profile.DBConnection._constr);
            int SelInd = 0;

            SelInd = ddlUOM.SelectedIndex;
            decimal SelectedQty = decimal.Parse(dsUOMSelPrd.Tables[0].Rows[SelInd]["Quantity"].ToString());
            decimal UserQty     = decimal.Parse(ds.Tables[0].Rows[0]["OrderQty"].ToString());

            txtReqQty.Value = Convert.ToString(UserQty / SelectedQty);
        }