示例#1
0
        private void LoadOptions()
        {
            Int64 iID = Convert.ToInt64(Common.Decrypt(Request.QueryString["id"], Session.SessionID));

            lblMatrixID.Text = iID.ToString();

            Int64 prodID = Convert.ToInt64(Common.Decrypt(Request.QueryString["prodid"], Session.SessionID));

            lblProductID.Text = prodID.ToString();

            ProductUnitsMatrix clsUnitMatrix = new ProductUnitsMatrix();

            cboBottomUnit.DataTextField  = "UnitName";
            cboBottomUnit.DataValueField = "UnitID";
            cboBottomUnit.DataSource     = clsUnitMatrix.AvailableUnitsForProduct(prodID).DefaultView;
            cboBottomUnit.DataBind();
            cboBottomUnit.SelectedIndex = cboBottomUnit.Items.Count - 1;

            clsUnitMatrix.CommitAndDispose();
        }
示例#2
0
        private void LoadOptions()
        {
            Int64 prodid = Convert.ToInt64(Common.Decrypt(Request.QueryString["prodid"].ToString(), Session.SessionID));

            lblProductID.Text = Convert.ToString(prodid);

            ProductUnitsMatrix        clsUnitMatrix  = new ProductUnitsMatrix();
            ProductUnitsMatrixDetails clsUnitDetails = clsUnitMatrix.LastDetails(prodid);

            if (clsUnitDetails.BottomUnitName == null)
            {
                Products       clsProduct = new Products();
                ProductDetails clsDetails = new ProductDetails();
                clsDetails = clsProduct.Details(prodid);
                clsProduct.CommitAndDispose();

                txtBaseUnit.Text   = clsDetails.BaseUnitName;
                lblBaseUnitID.Text = Convert.ToString(clsDetails.BaseUnitID);
            }
            else
            {
                txtBaseUnit.Text   = clsUnitDetails.BottomUnitName;
                lblBaseUnitID.Text = Convert.ToString(clsUnitDetails.BottomUnitID);
            }

            cboBottomUnit.DataTextField  = "UnitName";
            cboBottomUnit.DataValueField = "UnitID";
            cboBottomUnit.DataSource     = clsUnitMatrix.AvailableUnitsForProduct(prodid).DefaultView;
            cboBottomUnit.DataBind();
            if (cboBottomUnit.Items.Contains(new ListItem(txtBaseUnit.Text, lblBaseUnitID.Text)))
            {
                cboBottomUnit.Items.RemoveAt(cboBottomUnit.Items.IndexOf(cboBottomUnit.Items.FindByValue(lblBaseUnitID.Text)));
            }
            cboBottomUnit.SelectedIndex = cboBottomUnit.Items.Count - 1;

            clsUnitMatrix.CommitAndDispose();
        }
示例#3
0
		private void LoadOptions()
		{
			Int64 prodid = Convert.ToInt64(Common.Decrypt(Request.QueryString["prodid"].ToString(),Session.SessionID));
			lblProductID.Text = Convert.ToString(prodid);
			
			ProductUnitsMatrix clsUnitMatrix = new ProductUnitsMatrix();
			ProductUnitsMatrixDetails clsUnitDetails = clsUnitMatrix.LastDetails(prodid);

			if (clsUnitDetails.BottomUnitName == null)
			{
				Products clsProduct = new Products();
				ProductDetails clsDetails = new ProductDetails();
                clsDetails = clsProduct.Details(prodid);
				clsProduct.CommitAndDispose();

				txtBaseUnit.Text = clsDetails.BaseUnitName;
				lblBaseUnitID.Text = Convert.ToString(clsDetails.BaseUnitID);
			}
			else
			{
				txtBaseUnit.Text = clsUnitDetails.BottomUnitName;
				lblBaseUnitID.Text = Convert.ToString(clsUnitDetails.BottomUnitID);
			}

			cboBottomUnit.DataTextField = "UnitName";
			cboBottomUnit.DataValueField = "UnitID";
			cboBottomUnit.DataSource = clsUnitMatrix.AvailableUnitsForProduct(prodid).DefaultView;
			cboBottomUnit.DataBind();
			if (cboBottomUnit.Items.Contains( new ListItem(txtBaseUnit.Text, lblBaseUnitID.Text)))
			{
				cboBottomUnit.Items.RemoveAt( cboBottomUnit.Items.IndexOf(cboBottomUnit.Items.FindByValue(lblBaseUnitID.Text)));
			}
			cboBottomUnit.SelectedIndex = cboBottomUnit.Items.Count - 1;

			clsUnitMatrix.CommitAndDispose();
		}
示例#4
0
		private void LoadOptions()
		{
            Int64 iID = Convert.ToInt64(Common.Decrypt(Request.QueryString["id"], Session.SessionID));
			lblMatrixID.Text = iID.ToString();

			Int64 prodID = Convert.ToInt64(Common.Decrypt(Request.QueryString["prodid"],Session.SessionID));
			lblProductID.Text = prodID.ToString();

			ProductUnitsMatrix clsUnitMatrix = new ProductUnitsMatrix();
			
			cboBottomUnit.DataTextField = "UnitName";
			cboBottomUnit.DataValueField = "UnitID";
			cboBottomUnit.DataSource = clsUnitMatrix.AvailableUnitsForProduct(prodID).DefaultView;
			cboBottomUnit.DataBind();
			cboBottomUnit.SelectedIndex = cboBottomUnit.Items.Count - 1;

			clsUnitMatrix.CommitAndDispose();	
		}