protected void ddlProcessID_SelectedIndexChanged(object sender, EventArgs e) { InitProcessID = ddlProcessID.SelectedValue; string FlowMachine = txtFlowMachine.Text; if (InitProcessID != "") { BindProcessInfo(FlowMachine, InitProcessID); FormControls = GetControls(InitProcessID); BindControls(); } }
protected void ddlProID_SelectedIndexChanged(object sender, EventArgs e) { InitProcessID = ddlProID.SelectedItem.Text; FormControls = GetControls(InitProcessID); BindControls(); }
protected override void LoadViewState(object savedState) { var myState = (object[])savedState; if ((myState[0] != null)) { base.LoadViewState(myState[0]); } if ((myState[1] != null)) { FormRightCollection items = new FormRightCollection(); #pragma warning disable 612,618 items = (FormRightCollection)XmlUtils.Deserialize(Convert.ToString(myState[1]), items.GetType()); #pragma warning restore 612,618 FormControls = items; } }
protected void SaveControl(object source, CommandEventArgs e) { string moduleName = Constants.ModuleName; string componentName = Constants.ComponentName; //Get the index of the row to save int index = gdFormSetting.EditItemIndex; FormRightInfo editItem = FormControls[index]; HiddenField hidControlID = (HiddenField)gdFormSetting.Items[index].FindControl("hidControlID"); TextBox txtControlID = (TextBox)gdFormSetting.Items[index].FindControl("txtControlID"); DropDownList ddlEnable = (DropDownList)gdFormSetting.Items[index].FindControl("ddlEnable"); DropDownList ddlRequire = (DropDownList)gdFormSetting.Items[index].FindControl("ddlRequire"); TextBox txtClientScript = (TextBox)gdFormSetting.Items[index].FindControl("txtClientScript"); //TextBox txtVote = (TextBox)gdFormSetting.Items[index].FindControl("txtVote"); TextBox txtErrorMessageResourceID = (TextBox)gdFormSetting.Items[index].FindControl("txtErrorMessageResourceID"); if (!String.IsNullOrEmpty(txtControlID.Text)) { editItem.ControlID = txtControlID.Text; editItem.Enable = Convert.ToBoolean(ddlEnable.SelectedValue); editItem.Require = Convert.ToBoolean(ddlRequire.SelectedValue); editItem.ClientScript = txtClientScript.Text; //editItem.addVote(txtVote.Text); editItem.ErrorMessageResourceID = txtErrorMessageResourceID.Text; FormRightController formRightCtrl = new FormRightController(moduleName, componentName, DataProvider.GetConnectionString()); formRightCtrl.UpdateFormRight(editItem, hidControlID.Value); } else { } if (AddMode) { FormRightController formRightCtrl = new FormRightController(moduleName, componentName, DataProvider.GetConnectionString()); List<string> proIDList = new List<string>(); for (int i = 0; i < ddlProID.Items.Count; i++) { proIDList.Add(ddlProID.Items[i].Text); } formRightCtrl.InsertFormRight(editItem, UserInfo.UserID, proIDList); //Remove the temporary added row FormControls = GetControls(InitProcessID); AddMode = false; } //Reset Edit Index gdFormSetting.EditItemIndex = -1; BindControls(); }
private FormRightCollection GetControls(string processID) { string moduleName = Constants.ModuleName; string componentName = Constants.ComponentName; FormRightController formRigthCtrl = new FormRightController(moduleName, componentName, DataProvider.GetConnectionString()); List<FormRightInfo> lstFormRightInfo = formRigthCtrl.GetFormRightSetting(processID); FormRightCollection col = new FormRightCollection(); for (int i = 0; i < lstFormRightInfo.Count; i++) { col.Add(lstFormRightInfo[i]); } return col; }