本文整理匯總了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);
}
}