/// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            T_WorkFlow_MDL model = new T_WorkFlow_MDL();

            if (ViewState["model"] != null)
            {
                model = (T_WorkFlow_MDL)ViewState["model"];
            }

            object obj = Comm.GetValueToObject(model, this.tbl);

            if (obj != null)
            {
                T_WorkFlow_MDL Newmodel = (T_WorkFlow_MDL)obj;
                Newmodel.RightListID = chkMenuRight.getSelectValue;
                switch ((CommonEnum.PageState)ViewState["ps"])
                {
                case CommonEnum.PageState.ADD:
                    int workFlowID = workFlowBLL.Add(Newmodel);

                    PublicModel.writeLog(SystemSet.EumLogType.AddData.ToString(), string.Concat("T_WorkFlow;key=", workFlowID,
                                                                                                ";CompanyID=", Newmodel.CompanyID, ";WorkFlowCode=", Newmodel.WorkFlowCode, ";WorkFlowName=", Newmodel.WorkFlowName));
                    break;

                case CommonEnum.PageState.EDIT:
                    T_WorkFlow_MDL tempObj = workFlowBLL.GetModel(Newmodel.WorkFlowID);
                    workFlowBLL.Update(Newmodel);

                    PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(), string.Concat("T_WorkFlow;key=", Newmodel.WorkFlowID,
                                                                                                ";CompanyID=", Newmodel.CompanyID, ";WorkFlowCode=", Newmodel.WorkFlowCode, ";WorkFlowName=", Newmodel.WorkFlowName));
                    break;
                }
            }
            Common.MessageBox.CloseLayerOpenWeb(this.Page);
        }
예제 #2
0
        /// <summary>
        /// 根据流程编号返回流程ID
        /// </summary>
        /// <param name="workFlowCode"></param>
        /// <param name="companyID"></param>
        /// <returns></returns>
        public static int getWorkFlowIdByWorkFlowCode(string workFlowCode, int companyID = 0)
        {
            T_WorkFlow_BLL workFlowBLL = new T_WorkFlow_BLL();
            string         strWhere    = " lower(WorkFlowCode)='" + workFlowCode.ToLower() + "' ";

            if (companyID > 0)
            {
                strWhere += "and CompanyID=" + companyID;
            }
            T_WorkFlow_MDL workFlowMDL = workFlowBLL.GetModelList(strWhere).ToList().FirstOrDefault();

            return(workFlowMDL == null ? 0 : workFlowMDL.WorkFlowID);
        }
 /// <summary>
 /// 绑定页面
 /// </summary>
 /// <param name="ID"></param>
 private void BindPage(string ID)
 {
     if (!String.IsNullOrWhiteSpace(ID))
     {
         T_WorkFlow_MDL model = workFlowBLL.GetModel(Common.ConvertEx.ToInt(ID));
         if (model != null)
         {
             PID.DataBindEx(Common.ConvertEx.ToInt(model.CompanyID), false);
             Comm.SetValueToPage(model, this.tbl);
             chkMenuRight.setSelectValue = model.RightListID;
             ViewState["model"]          = model;
         }
     }
 }
예제 #4
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        /// <param name="WorkFlowID"></param>
        /// <param name="pageInde"></param>
        private void BindGrid(int pageIndex)
        {
            T_WorkFlow_BLL wfBLL = new T_WorkFlow_BLL();
            T_WorkFlow_MDL wfMDL = wfBLL.GetModel(workFlowID);

            workFlowCode = wfMDL.WorkFlowCode;

            string sqlWhere = string.Empty;

            if (Common.ConvertEx.ToBool(Common.Session.GetSession("SuperAdmin")) == true)                                                                               //管理员管理员获取所有工程
            {
                sqlWhere = " AND AREA_CODE LIKE '" + Session["AREA_CODE"].ToString() + "%'";                                                                            //加区域了。
            }
            else if (Common.ConvertEx.ToBool(Common.Session.GetSession("SuperAdmin")) == false && Common.Session.GetSession("IsCompany") == false.ToString().ToLower()) //档案馆用户看自己的
            {
                sqlWhere = " AND AREA_CODE LIKE '" + Session["OLD_AREA_CODE"].ToString() + "%'";                                                                        //加区域了。
            }

            if (!String.IsNullOrEmpty(gcmc.Text))
            {
                sqlWhere += " AND gcmc like '%" + gcmc.Text + "%'";
            }
            if (!String.IsNullOrEmpty(gcbm.Text))
            {
                sqlWhere += " AND gcbm like '%" + gcbm.Text + "%'";
            }

            DataTable dt = null;

            if (Common.Session.GetSession("SuperAdmin").ToLower() == "true")
            {
                dt = flowDefineBLL.GetListPaging(workFlowID.ToString(), false, "", "", sqlWhere, pageSize, pageIndex, out itemCount);
            }
            else
            {
                dt = flowDefineBLL.GetListPaging(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;

            gvData.DataSource = dt;
            gvData.DataBind();
        }
예제 #5
0
        /// <summary>
        /// 默认 无父级
        /// </summary>
        /// <param name="noParent"></param>
        public void DataBindEx(int CompanyID, bool bParent)
        {
            List <T_WorkFlow_MDL> arealist = new List <T_WorkFlow_MDL>();

            arealist = (new T_WorkFlow_BLL()).GetModelList("CompanyID=" + CompanyID);
            if (bParent == false)
            {
                T_WorkFlow_MDL init = new T_WorkFlow_MDL();
                init.WorkFlowID   = 0;
                init.WorkFlowName = "无父级";
                arealist.Insert(0, init);
            }
            ddlWorkFlow.DataTextField  = "WorkFlowName";
            ddlWorkFlow.DataValueField = "WorkFlowID";
            ddlWorkFlow.DataSource     = arealist;
            ddlWorkFlow.DataBind();
        }
        public bool DelWrokFlow(string WorkFlowID)
        {
            bool flag = false;

            try {
                T_WorkFlow_MDL workFlowMDL = workFlowBLL.GetModel(ConvertEx.ToInt(WorkFlowID));
                if (workFlowMDL != null)
                {
                    PublicModel.writeLog(SystemSet.EumLogType.DelData.ToString(), string.Concat("T_WorkFlow;key=", workFlowMDL.WorkFlowID,
                                                                                                ";CompanyID=", workFlowMDL.CompanyID, ";WorkFlowCode=", workFlowMDL.WorkFlowCode, ";WorkFlowName=", workFlowMDL.WorkFlowName));
                }

                CBLL.WorkFlowManage cbll = new DigiPower.Onlinecol.Standard.CBLL.WorkFlowManage();
                cbll.Delete(Common.ConvertEx.ToInt(WorkFlowID));
                flag = true;
            } catch (Exception ex) {
                Common.LogUtil.Debug(this, "流程删除失败", ex);
            }
            return(flag);
        }
예제 #7
0
        /// <summary>
        /// 默认 无父级
        /// </summary>
        /// <param name="noParent"></param>
        public void DataBindEx(string AreaCode, bool bParent)
        {
            List <T_WorkFlow_MDL> arealist = new List <T_WorkFlow_MDL>();
            string strWhere = "SELECT TOP 1 CompanyID from T_Company t where LOWER(Area_Code)='" + AreaCode.ToLower() + "' ";

            strWhere += "and CompanyType=" + SystemSet._ARCHIVE;

            arealist = (new T_WorkFlow_BLL()).GetModelList("CompanyID=(" + strWhere + ")");
            if (bParent == false)
            {
                T_WorkFlow_MDL init = new T_WorkFlow_MDL();
                init.WorkFlowID   = 0;
                init.WorkFlowName = "无父级";
                arealist.Insert(0, init);
            }
            ddlWorkFlow.DataTextField  = "WorkFlowName";
            ddlWorkFlow.DataValueField = "WorkFlowID";
            ddlWorkFlow.DataSource     = arealist;
            ddlWorkFlow.DataBind();
        }