當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。