protected void lnkSaveDesignation_Click(object sender, EventArgs e) { var designations = new Designations(); foreach (GridViewRow gvRow in GridViewTable.Rows) { designations.Add(new Designation { Id = ((TextBox)gvRow.FindControl("txtCode")).Text, Description = ((TextBox)gvRow.FindControl("txtDescription")).Text, Level = ((TextBox)gvRow.FindControl("txtAccess")).Text, Action = (string.IsNullOrEmpty((((HiddenField)gvRow.FindControl("hdnAction")).Value)) ? Constants.UpdateAction : ((HiddenField)gvRow.FindControl("hdnAction")).Value), SlNo = ((HiddenField)gvRow.FindControl("hdnSno")).Value, CreatedDate = Dates.ToDateTime(((HiddenField)gvRow.FindControl("hidCreatedDate")).Value, DateFormat.Format_05) }); } var firstOrDefault = designations.FirstOrDefault(); if (firstOrDefault != null) { firstOrDefault.DataBaseInfo = UserContext.DataBaseInfo; } if (_controlPanel.SetDesignation(designations)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.DesignationSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "DESIGNATION SAVED", GlobalCustomResource.DesignationSaved, true); lnkAddNew.Enabled = true; lnkAddNew.Style.Add("cursor", "Pointer"); BindData(BindType.List); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.DesignationFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "DESIGNATION UPDATE FAILED", GlobalCustomResource.DesignationFailed, true); } }
protected void lnkAddNew_Click(object sender, EventArgs e) { var designations = new Designations(); lnkAddNew.Enabled = false; lnkAddNew.Style.Add("cursor", "Not-allowed"); designations.AddRange(from GridViewRow gvRow in GridViewTable.Rows select new Designation { Id = ((TextBox)gvRow.FindControl("txtCode")).Text, Description = ((TextBox)gvRow.FindControl("txtDescription")).Text, Level = ((TextBox)gvRow.FindControl("txtAccess")).Text, Action = Constants.UpdateAction }); designations.Add(new Designation { Action = Constants.InsertAction }); BindAccessLevel(designations); }
public void AddDesignation(CraftDesignation des) { Designations.Add(des); }
public void AddDesignation(WallBuilder des) { Designations.Add(des); }