protected void bt_Save_Click(object sender, EventArgs e) { if ((Guid)ViewState["ProcessID"] != Guid.Empty)//修改 { EWF_Flow_ProcessFinishBLL bll = new EWF_Flow_ProcessFinishBLL((Guid)ViewState["ProcessID"]); bll.Model.Name = tbx_Name.Text; bll.Model.DefaultNextProcess = new Guid(ddl_DefaultNextProcess.SelectedValue); bll.Model.Description = tbx_Description.Text; bll.Model.Sort = int.Parse(tbx_Sort.Text); if (!string.IsNullOrEmpty(ddl_FinishStatus.SelectedValue)) bll.Model.FinishStatus = int.Parse(ddl_FinishStatus.SelectedValue); bll.Update(); } else//新增 { EWF_Flow_ProcessFinishBLL bll = new EWF_Flow_ProcessFinishBLL(); bll.Model.App = (Guid)ViewState["AppID"]; bll.Model.Name = tbx_Name.Text; bll.Model.DefaultNextProcess = new Guid(ddl_DefaultNextProcess.SelectedValue); bll.Model.Description = tbx_Description.Text; if (!string.IsNullOrEmpty(ddl_Type.SelectedValue)) bll.Model.Type = int.Parse(ddl_Type.SelectedValue); bll.Model.Sort = int.Parse(tbx_Sort.Text); bll.Model.Type = 2; if (!string.IsNullOrEmpty(ddl_FinishStatus.SelectedValue)) bll.Model.FinishStatus = int.Parse(ddl_FinishStatus.SelectedValue); bll.Add(); } Response.Redirect("FlowProcessList.aspx?AppID=" + ViewState["AppID"].ToString()); }
private void BindData() { this.lb_ID.Text = ViewState["ProcessID"].ToString(); EWF_Flow_ProcessFinishBLL bll = new EWF_Flow_ProcessFinishBLL((Guid)ViewState["ProcessID"]); #region 绑定基本信息 tbx_Name.Text = bll.Model.Name; tbx_Description.Text = bll.Model.Description; ddl_DefaultNextProcess.SelectedValue = bll.Model.DefaultNextProcess.ToString(); ddl_Type.SelectedValue = bll.Model.Type.ToString(); tbx_Sort.Text = bll.Model.Sort.ToString(); ddl_FinishStatus.SelectedValue = bll.Model.FinishStatus.ToString(); #endregion }
protected void bt_Save_Click(object sender, EventArgs e) { if ((Guid)ViewState["ProcessID"] != Guid.Empty)//修改 { EWF_Flow_ProcessFinishBLL bll = new EWF_Flow_ProcessFinishBLL((Guid)ViewState["ProcessID"]); bll.Model.Name = tbx_Name.Text; bll.Model.DefaultNextProcess = new Guid(ddl_DefaultNextProcess.SelectedValue); bll.Model.Description = tbx_Description.Text; bll.Model.Sort = int.Parse(tbx_Sort.Text); if (!string.IsNullOrEmpty(ddl_FinishStatus.SelectedValue)) { bll.Model.FinishStatus = int.Parse(ddl_FinishStatus.SelectedValue); } bll.Update(); } else//新增 { EWF_Flow_ProcessFinishBLL bll = new EWF_Flow_ProcessFinishBLL(); bll.Model.App = (Guid)ViewState["AppID"]; bll.Model.Name = tbx_Name.Text; bll.Model.DefaultNextProcess = new Guid(ddl_DefaultNextProcess.SelectedValue); bll.Model.Description = tbx_Description.Text; if (!string.IsNullOrEmpty(ddl_Type.SelectedValue)) { bll.Model.Type = int.Parse(ddl_Type.SelectedValue); } bll.Model.Sort = int.Parse(tbx_Sort.Text); bll.Model.Type = 2; if (!string.IsNullOrEmpty(ddl_FinishStatus.SelectedValue)) { bll.Model.FinishStatus = int.Parse(ddl_FinishStatus.SelectedValue); } bll.Add(); } Response.Redirect("FlowProcessList.aspx?AppID=" + ViewState["AppID"].ToString()); }