Example #1
0
        private void BindData()
        {
            MeasureWeight measureWeight = MeasureManager.GetMeasureWeightById(this.MeasureWeightId);

            if (measureWeight != null)
            {
                this.txtName.Text          = measureWeight.Name;
                this.txtSystemKeyword.Text = measureWeight.SystemKeyword;
                this.txtRatio.Value        = measureWeight.Ratio;
                this.txtDisplayOrder.Value = measureWeight.DisplayOrder;
            }
        }
Example #2
0
        public MeasureWeight SaveInfo()
        {
            string  name          = txtName.Text;
            string  systemKeyword = txtSystemKeyword.Text;
            decimal ratio         = txtRatio.Value;
            int     displayOrder  = txtDisplayOrder.Value;

            MeasureWeight measureWeight = MeasureManager.GetMeasureWeightById(this.MeasureWeightId);

            if (measureWeight != null)
            {
                measureWeight = MeasureManager.UpdateMeasureWeight(measureWeight.MeasureWeightId,
                                                                   name, systemKeyword, ratio, displayOrder);
            }
            else
            {
                measureWeight = MeasureManager.InsertMeasureWeight(name,
                                                                   systemKeyword, ratio, displayOrder);
            }

            return(measureWeight);
        }
Example #3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                //dimensions
                foreach (GridViewRow row in gvDimensions.Rows)
                {
                    RadioButton rdbIsPrimaryDimension = (RadioButton)row.FindControl("rdbIsPrimaryDimension");
                    HiddenField hfMeasureDimensionId  = (HiddenField)row.FindControl("hfMeasureDimensionId");
                    int         measureDimensionId    = int.Parse(hfMeasureDimensionId.Value);
                    if (rdbIsPrimaryDimension.Checked)
                    {
                        MeasureManager.BaseDimensionIn = MeasureManager.GetMeasureDimensionById(measureDimensionId);
                    }
                }

                //weights
                foreach (GridViewRow row in gvWeights.Rows)
                {
                    RadioButton rdbIsPrimaryWeight = (RadioButton)row.FindControl("rdbIsPrimaryWeight");
                    HiddenField hfMeasureWeightId  = (HiddenField)row.FindControl("hfMeasureWeightId");
                    int         measureWeightId    = int.Parse(hfMeasureWeightId.Value);
                    if (rdbIsPrimaryWeight.Checked)
                    {
                        MeasureManager.BaseWeightIn = MeasureManager.GetMeasureWeightById(measureWeightId);
                    }
                }

                BindDimensions();
                BindWeights();
            }
            catch (Exception exc)
            {
                ProcessException(exc);
            }
        }