本文整理汇总了C#中CommandParameters.AddCommandArgument方法的典型用法代码示例。如果您正苦于以下问题:C# CommandParameters.AddCommandArgument方法的具体用法?C# CommandParameters.AddCommandArgument怎么用?C# CommandParameters.AddCommandArgument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommandParameters
的用法示例。
在下文中一共展示了CommandParameters.AddCommandArgument方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OkButton_Click
protected void OkButton_Click(object sender, EventArgs e)
{
string refreshCommand = Mediachase.Ibn.Web.UI.WebControls.CommandHandler.GetRefreshCommand(this.Page);
string paramString = String.Empty;
if (!String.IsNullOrEmpty(refreshCommand))
{
CommandParameters cp = new CommandParameters(refreshCommand);
cp.CommandArguments = new Dictionary<string, string>();
cp.AddCommandArgument("DeleteType", DeleteTypeList.SelectedValue);
if (ObjectId != PrimaryKeyId.Empty)
{
cp.AddCommandArgument("ObjectId", ObjectId.ToString());
paramString = cp.ToString();
}
else if (Request.QueryString["GridId"] != null)
{
cp.AddCommandArgument("GridId", Request.QueryString["GridId"]);
paramString = cp.ToString();
}
else
{
paramString = String.Empty;
}
}
Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, paramString);
}
示例2: btnExport_Click
protected void btnExport_Click(object sender, EventArgs e)
{
CommandParameters cp = new CommandParameters(_refreshCommand);
cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
cp.AddCommandArgument("Type", _type);
cp.AddCommandArgument("Variant", rbList.SelectedValue);
Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
}
示例3: btnCancel_Click
void btnCancel_Click(object sender, EventArgs e)
{
CommandParameters cp = new CommandParameters(Request["CommandName"]);
cp.CommandArguments = new Dictionary<string, string>();
cp.AddCommandArgument("Uid", "null");
CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
}
示例4: btnOnlyThis_Click
void btnOnlyThis_Click(object sender, EventArgs e)
{
PrimaryKeyId pKey = PrimaryKeyId.Parse(Request["ObjectId"]);
CommandParameters cp = new CommandParameters(Request["CommandName"]);
cp.CommandArguments = new Dictionary<string, string>();
cp.AddCommandArgument("Uid", pKey.ToString());
CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
}
示例5: btnSave_Click
protected void btnSave_Click(object sender, System.EventArgs e)
{
DataTable dt = (DataTable)ViewState["Resources"];
string sResponsible = "";
foreach (DataRow dr in dt.Rows)
sResponsible += dr["UserId"].ToString() + "_";
if (Request["Command"] != null)
{
CommandParameters cp = new CommandParameters(Request["Command"]);
cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
cp.AddCommandArgument("Key", sResponsible);
Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
}
else
Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(),
String.Format("try{{window.opener.{0};}} catch (e){{}} window.close();", RefreshButton.Replace("xxx", sResponsible)),
true);
}
示例6: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
GetCurrentFolder();
CHelper.AddToContext(_folderIdKey, _folderId.ToString());
CHelper.AddToContext(_containerKeyKey, _containerKey);
CHelper.AddToContext(_containerNameKey, _containerName);
if (!Page.IsPostBack)
{
BindBlockHeader();
if (_pc["fs_ViewStyle"] == null)
_pc["fs_ViewStyle"] = "ListView";
}
_viewName = _pc["fs_ViewStyle"];
grdMain.ClassName = _className;
grdMain.ViewName = _viewName;
grdMain.PlaceName = _placeName;
MainMetaToolbar.ClassName = _className;
MainMetaToolbar.ViewName = _viewName;
MainMetaToolbar.PlaceName = _placeName;
CommandManager cm = CommandManager.GetCurrent(this.Page);
CommandParameters cp = new CommandParameters("FL_ChangeFolderTree");
cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
cp.AddCommandArgument("ContainerKey", _containerKey);
cp.AddCommandArgument("FolderId", _rootId.ToString());
string cmd = cm.AddCommand(_className, _viewName, _placeName, cp);
cmd = cmd.Replace("\"", """);
jsTreeExt.FolderId = _folderId.ToString();
jsTreeExt.IconUrl = ResolveClientUrl("~/layouts/images/folder.gif");
jsTreeExt.RootHrefCommand = String.Format("javascript:{0}", cmd);
jsTreeExt.RootId = _rootId.ToString();
jsTreeExt.RootNodeText = LocRM.GetString("tRoot");
jsTreeExt.TreeSourceUrl = ResolveClientUrl("~/Apps/FileLibrary/Pages/FileLibraryTreeSource.aspx?ContainerName=" + _containerName + "&ContainerKey=" + _containerKey + "&FolderId=" + _folderId);
BindDataGrid(!Page.IsPostBack);
cm.AddCommand(_className, _viewName, _placeName, "FL_Selected_MoveToFolder");
}
示例7: btnSave_ServerClick
void btnSave_ServerClick(object sender, EventArgs e)
{
SaveValues();
if (Request["IncidentId"] != null)
{
CommandManager cm = CommandManager.GetCurrent(this.Page);
CommandParameters cp = new CommandParameters("MC_HDM_PrintIssue");
cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
cp.AddCommandArgument("IncidentId", Request["IncidentId"]);
string cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
ClientScript.RegisterStartupScript(this.Page, this.GetType(), Guid.NewGuid().ToString("N"),
String.Format(@"function closeWin()
{{
try{{
window.parent.{1}();
}}
catch(ex){{;}}
}}
function openWin()
{{
try{{
{0};
setTimeout('closeWin()', 500);
}}
catch(ex){{
setTimeout('openWin()', 500);
}}
}}
setTimeout('openWin()', 1000);",
cmd, Request["closeFramePopup"]), true);
}
else
Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, String.Empty);
}
示例8: BindResponsible
private void BindResponsible(GeneralIncidentBoxBlock gibb)
{
// ddResponsible.Visible = false;
// lblResponsible.Visible = true;
// lblChangeButton.Visible = true;
// lblResponsible.Text = "";
// lblChangeButton.Text = "";
lblForResp.Text = LocRM.GetString("tPool") + ":";
string sResps = "";
string sUsers = "";
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("PureName", typeof(string)));
dt.Columns.Add(new DataColumn("UserName", typeof(string)));
DataRow dr;
if (gibb.ResponsiblePool != null)
foreach (int iUserId in gibb.ResponsiblePool)
{
sUsers += iUserId + "_";
dr = dt.NewRow();
dr["PureName"] = Util.CommonHelper.GetUserStatusPureName(iUserId);
dr["UserName"] = Util.CommonHelper.GetUserStatus(iUserId);
dt.Rows.Add(dr);
}
DataView dv = dt.DefaultView;
dv.Sort = "PureName";
foreach (DataRowView drv in dv)
sResps += drv["UserName"].ToString() + "<br />";
if (sResps.Length == 0)
sResps = " ";
lblResponsible.Text = String.Format("<span class='text' style='width:180px;'>{0}</span> ",
sResps);
CommandManager cm = CommandManager.GetCurrent(this.Page);
CommandParameters cp = new CommandParameters("MC_HDM_AdminResponsiblePool");
cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
cp.AddCommandArgument("sUsersKey", sUsers);
string cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
cmd = cmd.Replace("\"", """);
lblChangeButton.Text = String.Format("<a href=\"javascript:{{{2}}}\"><img align='absmiddle' border='0' src='{0}' /> {1}</a>",
ResolveClientUrl("~/layouts/images/icons/regular.gif"),
LocRM.GetString("tChange"), cmd);
}
示例9: BindFromValue
/// <summary>
/// Binds from value.
/// </summary>
private void BindFromValue(string metaClassName)
{
CommandParameters cp = new CommandParameters("MC_MUI_EntityDDSmall");
cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
if (!String.IsNullOrEmpty(metaClassName))
cp.AddCommandArgument("Classes", metaClassName);
cp.AddCommandArgument("Refresh", String.Format("Refresh{0}", this.ID));
//Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
string scriptToExecute = CommandManager.GetCurrent(this.Page).AddCommand(metaClassName, string.Empty, string.Empty, cp);
if (this.Value == null)
{
lblValue.Text = CHelper.GetResFileString("{IbnFramework.Common:tFilterSelectObject}");
}
else
{
PrimaryKeyId id = PrimaryKeyId.Parse(this.Value.ToString());
EntityObject obj = BusinessManager.Load(metaClassName, id);
MetaClass mc = MetaDataWrapper.GetMetaClassByName(obj.MetaClassName);
lblValue.Text = obj.Properties[mc.TitleFieldName].Value.ToString();
}
lblValue.Attributes.Add("onclick", scriptToExecute);
}
示例10: BindList
private void BindList()
{
DataTable dt = null;
if (ViewState["ResponsiblePool"] != null)
dt = ((DataTable)ViewState["ResponsiblePool"]).Copy();
string sUsers = "";
if (dt != null)
foreach (DataRow dr in dt.Rows)
{
if ((bool)dr["ResponsePending"])
sUsers += dr["PrincipalId"].ToString() + "*1_";
else
sUsers += dr["PrincipalId"].ToString() + "*0_";
}
tableDD.Rows.Clear();
HtmlTableRow tr = null;
HtmlTableCell tc = null;
CommandManager cm = CommandManager.GetCurrent(this.Page);
CommandParameters cp = null;
string cmd = String.Empty;
//NotChange
tr = new HtmlTableRow();
tc = CreateDDCell("SelectThis(this, -3)");
tc.InnerHtml = " ";
tr.Cells.Add(tc);
tableDD.Rows.Add(tr);
//NotSet
tr = new HtmlTableRow();
tc = CreateDDCell("SelectThis(this, -2)");
tc.InnerHtml = BuildIconAndText("not_set.png", "tRespNotSet");
tr.Cells.Add(tc);
tableDD.Rows.Add(tr);
//Group Resp
tr = new HtmlTableRow();
tc = CreateDDCell("SelectThis(this, -1)");
if (IsAllDenied())
{
if (!Mediachase.IBN.Business.Security.CurrentUser.IsExternal)
{
cp = new CommandParameters("MC_HDM_GroupResponsibilityInFrame");
cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
cp.AddCommandArgument("sUsersKey", sUsers);
cp.AddCommandArgument("NotChangeKey", "0");
cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
tc.InnerHtml = BuildLinkWithIconAndText("red_denied.gif", "tRespGroup", cmd);
}
else
tc.InnerHtml = BuildIconAndText("red_denied.gif", "tRespGroup");
}
else
{
if (!Mediachase.IBN.Business.Security.CurrentUser.IsExternal)
{
cp = new CommandParameters("MC_HDM_GroupResponsibilityInFrame");
cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
cp.AddCommandArgument("sUsersKey", sUsers);
cp.AddCommandArgument("NotChangeKey", "0");
cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
tc.InnerHtml = BuildLinkWithIconAndText("waiting.gif", "tRespGroup", cmd);
}
else
tc.InnerHtml = BuildIconAndText("waiting.gif", "tRespGroup");
}
tr.Cells.Add(tc);
tableDD.Rows.Add(tr);
//User
tr = new HtmlTableRow();
tc = CreateDDCell("SelectThis(this, " + Mediachase.IBN.Business.Security.CurrentUser.UserID + ")");
tc.InnerHtml = Mediachase.UI.Web.Util.CommonHelper.GetUserStatusUL(Mediachase.IBN.Business.Security.CurrentUser.UserID);
tr.Cells.Add(tc);
tableDD.Rows.Add(tr);
//MORE
cp = new CommandParameters("MC_HDM_SelectResourceInFrame");
cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
cmd = "closeMenu();" + cmd;
tr = new HtmlTableRow();
tc = CreateDDCell(cmd);
tc.InnerHtml = String.Format("<b>{0}</b>", LocRM.GetString("tRespMore"));
tr.Cells.Add(tc);
tableDD.Rows.Add(tr);
}
示例11: BindToolbar
//.........这里部分代码省略.........
#endregion
#region Timesheet
// OR [2007-08-23]: We should use IbnNext TimeTracking
/*
if (Configuration.ProjectManagementEnabled)
{
subItem = new ComponentArt.Web.UI.MenuItem();
subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/timesheet.gif";
subItem.Look.LeftIconWidth = Unit.Pixel(16);
subItem.Look.LeftIconHeight = Unit.Pixel(16);
string sPath = (Security.CurrentUser.IsExternal) ? "../External/ExternalTimeTracking.aspx" : "../TimeTracking/TimeTrackingWeek.aspx";
subItem.ClientSideCommand = String.Format("javascript:ShowWizard('{0}?IncidentId={1}', {2});",
sPath, IncidentId, (Security.CurrentUser.IsExternal) ? "800,600" : "450, 200");
subItem.Text = LocRM.GetString("tbAddTimeSheet");
topMenuItem.Items.Add(subItem);
}
*/
#endregion
#region UpdateHistory
if (!isExternal)
{
subItem = new ComponentArt.Web.UI.MenuItem();
subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/SystemEventsByObject.aspx?ObjectId={0}&ObjectTypeId={1}', 750, 466);", IncidentId, (int)ObjectTypes.Issue);
subItem.Text = LocRM3.GetString("UpdateHistory");
topMenuItem.Items.Add(subItem);
}
#endregion
#region Latest Visitors
if (!isExternal)
{
subItem = new ComponentArt.Web.UI.MenuItem();
subItem.ClientSideCommand = String.Format("javascript:ShowWizard('../Common/LatestVisitors.aspx?ObjectId={0}&ObjectTypeId={1}', 450, 266);", IncidentId, (int)ObjectTypes.Issue);
subItem.Text = LocRM3.GetString("LatestVisitors");
topMenuItem.Items.Add(subItem);
}
#endregion
#region System Notifications
if (!isExternal)
{
subItem = new ComponentArt.Web.UI.MenuItem();
subItem.Look.LeftIconUrl = "~/Layouts/Images/accept_1.gif";
subItem.Look.LeftIconWidth = Unit.Pixel(16);
subItem.Look.LeftIconHeight = Unit.Pixel(16);
subItem.NavigateUrl = String.Format("../Directory/SystemNotificationForObject.aspx?ObjectId={0}&ObjectTypeId={1}", IncidentId, ((int)ObjectTypes.Issue).ToString());
subItem.Text = LocRM2.GetString("SystemNotifications");
topMenuItem.Items.Add(subItem);
}
#endregion
#region Favorites
if (!Incident.CheckFavorites(IncidentId) && !isExternal)
{
subItem = new ComponentArt.Web.UI.MenuItem();
subItem.Look.LeftIconUrl = "~/Layouts/Images/Favorites.gif";
subItem.Look.LeftIconWidth = Unit.Pixel(16);
subItem.Look.LeftIconHeight = Unit.Pixel(16);
subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(btnAddToFavorites, "");
subItem.Text = LocRM.GetString("AddToFavorites");
topMenuItem.Items.Add(subItem);
}
#endregion
#region PrintPreviewSettings
if (!isExternal)
{
subItem = new ComponentArt.Web.UI.MenuItem();
subItem.Look.LeftIconUrl = "~/Layouts/Images/printPreviewButton.png";
subItem.Look.LeftIconWidth = Unit.Pixel(16);
subItem.Look.LeftIconHeight = Unit.Pixel(16);
cp = new CommandParameters("MC_HDM_PrintPreviewSettings");
cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
cp.AddCommandArgument("IncidentId", IncidentId.ToString());
cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
cmd = cmd.Replace("\"", """);
subItem.ClientSideCommand = "javascript:" + cmd;
subItem.Text = LocRM.GetString("PrintSettings");
topMenuItem.Items.Add(subItem);
subItem = new ComponentArt.Web.UI.MenuItem();
subItem.Look.LeftIconUrl = "~/Layouts/Images/print.gif";
subItem.Look.LeftIconWidth = Unit.Pixel(16);
subItem.Look.LeftIconHeight = Unit.Pixel(16);
cp = new CommandParameters("MC_HDM_PrintIssue");
cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
cp.AddCommandArgument("IncidentId", IncidentId.ToString());
cmd = cm.AddCommand("Incident", "", "IncidentView", cp);
cmd = cmd.Replace("\"", """);
subItem.ClientSideCommand = "javascript:" + cmd;
subItem.Text = LocRM.GetString("PrintIssue");
topMenuItem.Items.Add(subItem);
}
#endregion
if (topMenuItem.Items.Count > 0)
secHeader.ActionsMenu.Items.Add(topMenuItem);
}
示例12: OnSelectMethod
private void OnSelectMethod(string values)
{
CommandParameters cp = new CommandParameters();
switch (_className)
{
case "Incident":
cp.CommandName = "MC_HDM_RelatedIss";
break;
case "Project":
cp.CommandName = "MC_PM_RelatedPrj";
break;
default:
break;
}
if (Request["ReturnCommand"] != null)
cp.CommandName = Request["ReturnCommand"];
cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
cp.AddCommandArgument("ClassName", _className);
if (Request["ObjectId"] != null)
cp.AddCommandArgument("ObjectId", Request["ObjectId"]);
if (Request["GridId"] != null)
cp.AddCommandArgument("GridId", Request["GridId"]);
cp.AddCommandArgument("SelectedValue", values);
if (_className == "User")
cp.AddCommandArgument("SelectedHtml", Mediachase.UI.Web.Util.CommonHelper.GetUserStatusUL(int.Parse(values)));
if (!String.IsNullOrEmpty(Request["SelectCtrlId"]))
{
string[] mas = values.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
if (mas.Length > 0)
{
cp.AddCommandArgument("SelectObjectId", mas[0]);
cp.AddCommandArgument("SelectCtrlId", Request["SelectCtrlId"]);
switch (_className)
{
case "Project":
cp.AddCommandArgument("SelectObjectTypeId", "3");
cp.AddCommandArgument("Html", CommonHelper.GetObjectHTMLTitle(3, int.Parse(mas[0])));
break;
case "User":
cp.AddCommandArgument("SelectObjectTypeId", "1");
cp.AddCommandArgument("Html", CommonHelper.GetObjectHTMLTitle(1, int.Parse(mas[0])));
break;
default:
break;
}
}
}
Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
}
示例13: btnSave_ServerClick
protected void btnSave_ServerClick(object sender, EventArgs e)
{
this.Page.Validate();
if (!this.Page.IsValid)
{
btnSave.Attributes.Remove("onclick");
btnCancel.Attributes.Remove("onclick");
return;
}
EntityObject _bindObject = BusinessManager.InitializeEntity(ddFilter.SelectedValue);
if (_bindObject != null)
{
ProcessCollection(this.Page.Controls, (EntityObject)_bindObject);
// Save container id
if (!String.IsNullOrEmpty(ContainerFieldName)
&& ((EntityObject)_bindObject).Properties[ContainerFieldName] != null
&& ContainerId != PrimaryKeyId.Empty)
{
((EntityObject)_bindObject)[ContainerFieldName] = ContainerId;
}
PrimaryKeyId objectId = BusinessManager.Create(_bindObject);
CommandParameters cp = new CommandParameters("MC_MUI_EntityDD");
if (Request["ReturnCommand"] != null)
cp.CommandName = Request["ReturnCommand"];
cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
cp.AddCommandArgument("ClassName", ddFilter.SelectedValue);
if (Request["ObjectId"] != null)
cp.AddCommandArgument("ObjectId", Request["ObjectId"]);
if (Request["GridId"] != null)
cp.AddCommandArgument("GridId", Request["GridId"]);
cp.AddCommandArgument("SelectedValue", objectId.ToString());
cp.AddCommandArgument("SelectObjectId", objectId.ToString());
cp.AddCommandArgument("SelectObjectType", ddFilter.SelectedValue);
cp.AddCommandArgument("Html", CHelper.GetEntityTitleHtml(ddFilter.SelectedValue, objectId));
if (!String.IsNullOrEmpty(Request["SelectCtrlId"]))
cp.AddCommandArgument("SelectCtrlId", Request["SelectCtrlId"]);
Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
}
}
示例14: lbSave_Click
protected void lbSave_Click(object sender, EventArgs e)
{
btnSave.Disabled = true;
btnCancel.Disabled = true;
CommandParameters cp = new CommandParameters("MC_MUI_EntityDD");
if (Request["ReturnCommand"] != null)
cp.CommandName = Request["ReturnCommand"];
cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
cp.AddCommandArgument("ClassName", ddFilter.SelectedValue);
if (Request["ObjectId"] != null)
cp.AddCommandArgument("ObjectId", Request["ObjectId"]);
if (Request["GridId"] != null)
cp.AddCommandArgument("GridId", Request["GridId"]);
if (TreeServiceTargetObjectId != PrimaryKeyId.Empty)
cp.AddCommandArgument("TreeServiceTargetObjectId", TreeServiceTargetObjectId.ToString());
cp.AddCommandArgument("SelectedValue", hdnValue.Value);
if (!String.IsNullOrEmpty(Request["SelectCtrlId"]))
{
string[] mas = hdnValue.Value.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
if (mas.Length > 0)
{
string uid = MetaViewGroupUtil.GetIdFromUniqueKey(mas[0]);
if (uid != "null")
{
cp.AddCommandArgument("SelectObjectId", uid);
cp.AddCommandArgument("SelectCtrlId", Request["SelectCtrlId"]);
cp.AddCommandArgument("SelectObjectType", ddFilter.SelectedValue);
cp.AddCommandArgument("Html", CHelper.GetEntityTitleHtml(ddFilter.SelectedValue, PrimaryKeyId.Parse(uid)));
}
}
}
Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
}
示例15: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
Page.Validate();
if (Page.IsValid)
{
ListViewProfile profile;
if (!String.IsNullOrEmpty(_uid))
profile = ListViewProfile.Load(_className, _uid, _placeName);
else
profile = new ListViewProfile();
//fields
List<string> fields = new List<string>();
ColumnPropertiesCollection coll = new ColumnPropertiesCollection();
List<ListItem> items = ListSelector.GetSelectedItems();
foreach (ListItem item in items)
{
fields.Add(item.Value);
coll.Add(new ColumnProperties(item.Value, "150", String.Empty));
}
profile.FieldSet = fields;
profile.ColumnsUI = coll;
string uid = (!String.IsNullOrEmpty(_uid)) ? _uid : Guid.NewGuid().ToString();
profile.Id = uid;
profile.Name = txtTitle.Text;
profile.ReadOnly = false;
int currentUserId = Mediachase.Ibn.Data.Services.Security.CurrentUserId;
if (_isSystem)
{
profile.IsSystem = true;
profile.IsPublic = true;
ListViewProfile.SaveSystemProfile(_className, _placeName, currentUserId, profile);
}
else
{
profile.IsSystem = false;
profile.IsPublic = cbIsPublic.Checked;
ListViewProfile.SaveCustomProfile(_className, _placeName, currentUserId, profile);
}
SaveFilters(uid);
CommandParameters cp = new CommandParameters(_commandName);
cp.CommandArguments = new System.Collections.Generic.Dictionary<string, string>();
cp.AddCommandArgument("ViewUid", uid);
cp.AddCommandArgument("ClassName", _className);
cp.AddCommandArgument("PlaceName", _placeName);
Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString());
}
}