当前位置: 首页>>代码示例>>C#>>正文


C# Color.LoadByPrimaryKey方法代码示例

本文整理汇总了C#中Color.LoadByPrimaryKey方法的典型用法代码示例。如果您正苦于以下问题:C# Color.LoadByPrimaryKey方法的具体用法?C# Color.LoadByPrimaryKey怎么用?C# Color.LoadByPrimaryKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Color的用法示例。


在下文中一共展示了Color.LoadByPrimaryKey方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: uiGridViewColors_RowCommand

        protected void uiGridViewColors_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "EditColor")
            {
                Color objData = new Color();
                objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));

                uiTextBoxEnName.Text = objData.ColorNameEng;
                uiTextBoxArName.Text = objData.ColorNameAr;
                uiTextBoxColorCode.Text = objData.ColorCode;
                uiPanelAllCats.Visible = false;
                uiPanelEditCat.Visible = true;
                CurrentColor = objData;

                BindColors();
            }
            else if (e.CommandName == "DeleteColor")
            {
                try
                {
                    Color objData = new Color();
                    objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
                    objData.MarkAsDeleted();
                    objData.Save();
                    CurrentColor = null;
                    BindColors();
                }
                catch (Exception ex)
                {
                    uipanelError.Visible = true;
                }
            }
        }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:33,代码来源:EditColors.aspx.cs

示例2: uiRepeaterColor_ItemDataBound

 protected void uiRepeaterColor_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
     {
         Literal l = (Literal)e.Item.FindControl("uiLiteralColor");
         DataRowView row = (DataRowView)e.Item.DataItem;
         Color c = new Color ();
         c.LoadByPrimaryKey(Convert.ToInt32(row["ColorID"].ToString()));
         l.Text = "<label style='background-color: #" + c.ColorCode + ";width:20px;height:20px;'></label>";
     }
 }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:11,代码来源:viewCard.aspx.cs

示例3: uiGridViewEnvelops_RowDataBound

        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();
            }
        }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:20,代码来源:EditEnvelops.aspx.cs

示例4: uiGridViewLayout_RowDataBound

        protected void uiGridViewLayout_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);

            }
        }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:15,代码来源:EditCards.aspx.cs


注:本文中的Color.LoadByPrimaryKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。