/// <summary> /// 更新 /// </summary> private void Update(int FlowWorkID) { BLL.T_WorkFlow_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_WorkFlow_BLL(); Model.T_WorkFlow_MDL Newmodel = bll.GetModel(Common.ConvertEx.ToInt(ID)); Newmodel = (Model.T_WorkFlow_MDL)Comm.GetValueToObject(Newmodel, this.tbl); CBLL.WorkFlowManage cbll = new DigiPower.Onlinecol.Standard.CBLL.WorkFlowManage(); cbll.Update(Newmodel); }
/// <summary> /// 绑定页面 /// </summary> /// <param name="ID"></param> private void BindPage(string ID) { BLL.T_WorkFlow_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_WorkFlow_BLL(); Model.T_WorkFlow_MDL model = bll.GetModel(Convert.ToInt32(ID)); if (model != null) { DigiPower.Onlinecol.Standard.Web.Comm.SetValueToPage(model, this.tbl); } }
/// <summary> /// 绑定数据 /// </summary> /// <param name="WorkFlowID"></param> /// <param name="pageInde"></param> private void BindGrid(int pageIndex) { BLL.T_WorkFlow_BLL wfBLL = new T_WorkFlow_BLL(); Model.T_WorkFlow_MDL wfMDL = wfBLL.GetModel(workFlowID); workFlowCode = wfMDL.WorkFlowCode; string sqlWhere = string.Empty; if (PublicModel.isSuperAdmin()) //管理员管理员获取所有工程 { sqlWhere = " AND AREA_CODE LIKE '" + Common.Session.GetSession("AREA_CODE") + "%'"; //加区域了。 } else if (PublicModel.isArchiveUser()) //档案馆用户看自己的 { sqlWhere = " AND AREA_CODE LIKE '" + Common.Session.GetSession("OLD_AREA_CODE") + "%'"; //加区域了。 } if (!String.IsNullOrEmpty(txtGcmc.Text)) { sqlWhere += " AND gcmc like '%" + txtGcmc.Text + "%'"; } if (!String.IsNullOrEmpty(txtGcbm.Text)) { sqlWhere += " AND gcbm like '%" + txtGcbm.Text + "%'"; } DataTable dt = null; if (ViewState["CurrentPageIndex"] == null && Common.ConvertEx.ToInt(DNTRequest.GetQueryString("PageIndex")) > 0) { pageIndex = Common.ConvertEx.ToInt(DNTRequest.GetQueryString("PageIndex")); ViewState["CurrentPageIndex"] = pageIndex; } else { pageIndex = ConvertEx.ToInt(ViewState["CurrentPageIndex"]); } if (PublicModel.isSuperAdmin()) { dt = flowDefineBLL.GetLHSignatureListPaging(workFlowID.ToString(), false, "", "", sqlWhere, pageSize, pageIndex, out itemCount); } else { dt = flowDefineBLL.GetLHSignatureListPaging(workFlowID.ToString(), Common.Session.GetSessionBool("IsCompany"), Common.Session.GetSession("RoleID"), Common.Session.GetSession("UserID"), sqlWhere, pageSize, pageIndex, out itemCount); } AspNetPager.AlwaysShow = true; AspNetPager.PageSize = pageSize; AspNetPager.RecordCount = itemCount; AspNetPager.CurrentPageIndex = pageIndex; gvData.DataSource = dt; gvData.DataBind(); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(DigiPower.Onlinecol.Standard.Model.T_WorkFlow_MDL model) { BLL.T_WorkFlow_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_WorkFlow_BLL(); Model.T_WorkFlow_MDL currentMDL = bll.GetModel(model.WorkFlowID); //原 父 ,可空 Model.T_WorkFlow_MDL oldParentMDL = bll.GetModel("WorkFlowID=" + currentMDL.PID); //原 子 ,可空 Model.T_WorkFlow_MDL oldChildMDL = bll.GetModel("PID=" + currentMDL.WorkFlowID); //新 父 ,可空 Model.T_WorkFlow_MDL newParentMDL = bll.GetModel("WorkFlowID=" + model.PID); //新 子 ,新父的子,可空 Model.T_WorkFlow_MDL newChildMDL = null; if (newParentMDL != null) { newChildMDL = bll.GetModel("PID=" + newParentMDL.WorkFlowID); } else if (model.PID == 0) { newChildMDL = bll.GetModel("PID=" + model.PID); } bll.Update(model); //更新填的结果 if (oldChildMDL != null) // && newChildMDL.WorkFlowID > 0 { if (oldParentMDL != null) { oldChildMDL.PID = oldParentMDL.WorkFlowID; } else { oldChildMDL.PID = 0; } bll.Update(oldChildMDL); } if (newChildMDL != null)// && newChildMDL.WorkFlowID > 0 { newChildMDL.PID = model.WorkFlowID; bll.Update(newChildMDL); } }
public void Delete(int WorkFlowID) { BLL.T_WorkFlow_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_WorkFlow_BLL(); Model.T_WorkFlow_MDL currentMDL = bll.GetModel(WorkFlowID); //原 父 Model.T_WorkFlow_MDL oldParentMDL = bll.GetModel("WorkFlowID=" + currentMDL.PID); //原 子 Model.T_WorkFlow_MDL oldChildMDL = bll.GetModel("PID=" + currentMDL.WorkFlowID); if (oldChildMDL != null && oldParentMDL != null) { oldChildMDL.PID = oldParentMDL.WorkFlowID; bll.Update(oldChildMDL); } else if (oldChildMDL != null) { oldChildMDL.PID = 0; bll.Update(oldChildMDL); } bll.Delete(WorkFlowID); }
public int Add(DigiPower.Onlinecol.Standard.Model.T_WorkFlow_MDL model) { int WorkFlowID = 0; BLL.T_WorkFlow_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_WorkFlow_BLL(); if (model.PID == 0) { Model.T_WorkFlow_MDL newChildMDL = bll.GetModel("PID=" + model.PID); WorkFlowID = bll.Add(model); newChildMDL.PID = WorkFlowID; bll.Update(newChildMDL); } else { //新 父 Model.T_WorkFlow_MDL newParentMDL = bll.GetModel("WorkFlowID=" + model.PID); //新 子 Model.T_WorkFlow_MDL newChildMDL = bll.GetModel("PID=" + newParentMDL.WorkFlowID); WorkFlowID = bll.Add(model);//更新填的结果 //更新父子关系 Model.T_WorkFlow_MDL parentMDL = bll.GetModel("WorkFlowID=" + model.PID); if (newParentMDL != null) { if (newChildMDL != null) { newChildMDL.PID = WorkFlowID; bll.Update(newChildMDL); } } WorkFlowID = model.WorkFlowID; } return(WorkFlowID); }
/// <summary> /// 绑定数据 /// </summary> /// <param name="pageIndex"></param> private void BindGrid(int pageIndex) { BLL.T_WorkFlow_BLL wfBLL = new T_WorkFlow_BLL(); Model.T_WorkFlow_MDL wfMDL = wfBLL.GetModel(ConvertEx.ToInt(workFlowID)); workFlowCode = wfMDL.WorkFlowCode; string sqlWhere = string.Empty; if (PublicModel.isSuperAdmin()) //管理员管理员获取所有工程 { sqlWhere = " AND AREA_CODE LIKE '" + Common.Session.GetSession("AREA_CODE") + "%'"; } else if (PublicModel.isArchiveUser()) //档案馆用户看自己的 { sqlWhere = " AND AREA_CODE LIKE '" + Common.Session.GetSession("OLD_AREA_CODE") + "%'"; } if (!String.IsNullOrEmpty(gcmc.Text)) { sqlWhere += " AND gcmc like '%" + gcmc.Text + "%'"; } if (!String.IsNullOrEmpty(gcbm.Text)) { sqlWhere += " AND gcbm like '%" + gcbm.Text + "%'"; } if (ViewState["CurrentPageIndex"] == null && Common.ConvertEx.ToInt(DNTRequest.GetQueryString("PageIndex")) > 0) { pageIndex = Common.ConvertEx.ToInt(DNTRequest.GetQueryString("PageIndex")); ViewState["CurrentPageIndex"] = pageIndex; } else { pageIndex = ConvertEx.ToInt(ViewState["CurrentPageIndex"]); } bool isChargeUser = false; if ((SystemSet._DEFAULT_RECV_WORKFLOWID + ",").IndexOf(workFlowID + ",") > -1) { isChargeUser = true; } DataTable dt = null; if (PublicModel.isSuperAdmin()) { dt = flowDefineBLL.GetListPaging(workFlowID, false, "", "", sqlWhere, pageSize, pageIndex, out itemCount); } else { dt = flowDefineBLL.GetListPaging(workFlowID, Common.Session.GetSessionBool("IsCompany"), "", Common.Session.GetSession("UserID"), sqlWhere, pageSize, pageIndex, out itemCount, isChargeUser); } AspNetPager.AlwaysShow = true; AspNetPager.PageSize = pageSize; AspNetPager.RecordCount = itemCount; AspNetPager.CurrentPageIndex = pageIndex; rpData.DataSource = dt; rpData.DataBind(); }