本文整理汇总了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;
}
}
}
示例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>";
}
}
示例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();
}
}
示例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);
}
}