protected void uiGridViewDims_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "EditDim")
            {
                Dimension objData = new Dimension();
                objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));

                uiTextBoxWidth.Text = objData.Width.ToString();
                uiTextBoxHeight.Text = objData.Height.ToString();

                uiPanelAllCats.Visible = false;
                uiPanelEditCat.Visible = true;
                CurrentDim = objData;

                BindDims();
            }
            else if (e.CommandName == "DeleteDim")
            {
                try
                {
                    Dimension objData = new Dimension();
                    objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
                    objData.MarkAsDeleted();
                    objData.Save();
                    CurrentDim = null;
                    BindDims();
                }
                catch (Exception ex)
                {
                    uipanelError.Visible = true;
                }
            }
        }
示例#2
0
        private void LoadCheckBoxes()
        {
            Color colors = new Color();
            colors.LoadAll();
            uiRepeaterColors.DataSource = colors.DefaultView;
            uiRepeaterColors.DataBind();

            Dimension dims = new Dimension();
            dims.GetAllDims();
            uiRepeaterSizes.DataSource = dims.DefaultView;
            uiRepeaterSizes.DataBind();
        }
        protected void uiGridViewEnvelops_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                System.Web.UI.HtmlControls.HtmlGenericControl div = e.Row.FindControl("ColorDiv") as System.Web.UI.HtmlControls.HtmlGenericControl;

                int Colid = (int)DataBinder.Eval(e.Row.DataItem, "ColorID");
                Color col = new Color();
                col.LoadByPrimaryKey(Colid);

                string color = "#" + col.ColorCode;
                div.Attributes.CssStyle.Add("background-color", color);

                Label dim = (Label)e.Row.FindControl("uiLabelDim");
                int dimid = (int)DataBinder.Eval(e.Row.DataItem, "DimensionID");
                Dimension obj = new Dimension();
                obj.LoadByPrimaryKey(dimid);
                dim.Text = obj.Width.ToString() + " × " + obj.Height.ToString();
            }
        }
        private void LoadDDLs()
        {
            Color colors = new Color();
            colors.LoadAll();
            uiDropDownListColor.DataSource = colors.DefaultView;
            uiDropDownListColor.DataTextField = "ColorNameEng";
            uiDropDownListColor.DataValueField = "ColorID";
            uiDropDownListColor.DataBind();

            Dimension dims = new Dimension();
            dims.GetAllDims();
            uiDropDownListDim.DataSource = dims.DefaultView;
            uiDropDownListDim.DataTextField = "DisplayName";
            uiDropDownListDim.DataValueField = "DimensionID";
            uiDropDownListDim.DataBind();
        }
 protected void uiLinkButtonBack_Click(object sender, EventArgs e)
 {
     ClearFields();
     CurrentDim = null;
     uiPanelEditCat.Visible = false;
     uiPanelAllCats.Visible = true;
     BindDims();
 }
 private void BindDims()
 {
     Dimension cats = new Dimension();
     cats.LoadAll();
     uiGridViewDims.DataSource = cats.DefaultView;
     uiGridViewDims.DataBind();
 }
        protected void uiLinkButtonOK_Click(object sender, EventArgs e)
        {
            Dimension dim = new Dimension();
            if (CurrentDim == null)
                dim.AddNew();
            else
                dim = CurrentDim;

            try
            {
                dim.Width = Convert.ToDecimal(uiTextBoxWidth.Text);
                dim.Height = Convert.ToDecimal(uiTextBoxHeight.Text);

            }
            catch (Exception ex)
            {
                return;
            }
            dim.Save();
            ClearFields();
            CurrentDim = null;
            uiPanelEditCat.Visible = false;
            uiPanelAllCats.Visible = true;
            BindDims();
        }
示例#8
0
        private void LoadDDLs()
        {
            Color colors = new Color();
            colors.LoadAll();
            uiDropDownListColor.DataSource = colors.DefaultView;
            uiDropDownListColor.DataTextField = "ColorNameEng";
            uiDropDownListColor.DataValueField = "ColorID";
            uiDropDownListColor.DataBind();

            uiDropDownListBackColor.DataSource = colors.DefaultView;
            uiDropDownListBackColor.DataTextField = "ColorNameEng";
            uiDropDownListBackColor.DataValueField = "ColorID";
            uiDropDownListBackColor.DataBind();

            Dimension dims = new Dimension();
            dims.GetAllDims();
            uiDropDownListDim.DataSource = dims.DefaultView;
            uiDropDownListDim.DataTextField = "DisplayName";
            uiDropDownListDim.DataValueField = "DimensionID";
            uiDropDownListDim.DataBind();

            TopLevelCat Tcats = new TopLevelCat();
            Tcats.LoadAll();
            uiDropDownListTC.DataSource = Tcats.DefaultView;
            uiDropDownListTC.DataTextField = "NameEng";
            uiDropDownListTC.DataValueField = "TopLevelCatID";
            uiDropDownListTC.DataBind();
            LoadMainCat();
        }
示例#9
0
        private void LoadDDLs()
        {
            Color colors = new Color();
            colors.LoadAll();
            uiDropDownListColor.DataSource = colors.DefaultView;
            uiDropDownListColor.DataTextField = "ColorNameEng";
            uiDropDownListColor.DataValueField = "ColorID";
            uiDropDownListColor.DataBind();

            uiDropDownListBackColor.DataSource = colors.DefaultView;
            uiDropDownListBackColor.DataTextField = "ColorNameEng";
            uiDropDownListBackColor.DataValueField = "ColorID";
            uiDropDownListBackColor.DataBind();

            Dimension dims = new Dimension();
            dims.GetAllDims();
            uiDropDownListDim.DataSource = dims.DefaultView;
            uiDropDownListDim.DataTextField = "DisplayName";
            uiDropDownListDim.DataValueField = "DimensionID";
            uiDropDownListDim.DataBind();

            TopLevelCat Tcats = new TopLevelCat();
            Tcats.Where.IsPartySupplier.Value = true;
            Tcats.Where.IsPartySupplier.Operator = MyGeneration.dOOdads.WhereParameter.Operand.NotEqual;
            Tcats.Sort = "NameEng";
            Tcats.Query.Load();
            uiDropDownListTC.DataSource = Tcats.DefaultView;
            uiDropDownListTC.DataTextField = "NameEng";
            uiDropDownListTC.DataValueField = "TopLevelCatID";
            uiDropDownListTC.DataBind();
            LoadMainCat();
        }