Ejemplo n.º 1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            T_Construction_Project_BLL projectbll = new T_Construction_Project_BLL();
            T_Construction_Project_MDL obj        = new T_Construction_Project_MDL();

            obj = ctrlConstructionBaseInfo1.GetModule(Common.ConvertEx.ToInt(Common.DNTRequest.GetQueryString("ID")));
            //object obj = Comm.GetValueToObject(tmdl1, table1);
            int SingleProjectID = 0;

            if (obj != null)
            {
                T_Construction_Project_MDL newprojectmdl = (T_Construction_Project_MDL)obj;
                newprojectmdl.jgrq = DateTime.Now;
                if (((CommonEnum.PageState)ViewState["ps"]) == CommonEnum.PageState.ADD)
                {
                    newprojectmdl.CompanyID = Common.ConvertEx.ToInt(Common.Session.GetSession("CompanyID"));

                    //Leo 新增时,需要自动产生项目号
                    T_Other_BLL otherBLL = new T_Other_BLL();
                    newprojectmdl.xmh = otherBLL.GetNewProjectID();

                    SingleProjectID = projectbll.Add(newprojectmdl);
                    PublicModel.writeLog(SystemSet.EumLogType.AddData.ToString(),
                                         string.Concat("T_Construction_Project;key=", SingleProjectID, ";xmmc=", newprojectmdl.xmmc));
                }
                else
                {
                    projectbll.Update(newprojectmdl);
                    PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(),
                                         string.Concat("T_Construction_Project;key=", newprojectmdl.ConstructionProjectID, ";xmmc=", newprojectmdl.xmmc));
                }
            }
            Common.MessageBox.CloseLayerOpenWeb(this.Page);
        }
        private void DataBindEx()
        {
            T_Construction_Project_MDL projectmdl = (new T_Construction_Project_BLL()).GetModel(ConvertEx.ToInt(constructionprojectid.Value));

            Comm.SetValueToPage(projectmdl, table1);
            if (jsdw.Text == "")
            {
                jsdw.Text = Common.Session.GetSession("CompanyName");
            }
        }
        public T_Construction_Project_MDL GetModule(int tconstructionprojectid)
        {
            T_Construction_Project_MDL mdl = new T_Construction_Project_MDL();

            if (tconstructionprojectid > 0)
            {
                BLL.T_Construction_Project_BLL bll = new T_Construction_Project_BLL();
                mdl = bll.GetModel(tconstructionprojectid);
            }
            object obj = Comm.GetValueToObject(mdl, table1);

            return((T_Construction_Project_MDL)obj);
        }
Ejemplo n.º 4
0
        public bool DeleteConstruction(string ConstructionProjectID)
        {
            bool flag = false;
            T_Construction_Project_MDL mdl = bll1.GetModel(ConvertEx.ToInt(ConstructionProjectID));

            if (mdl != null)
            {
                if (!new T_Other_BLL().GetSingleProjectExistByConstructionID(ConstructionProjectID))
                {
                    bll1.Delete(mdl.ConstructionProjectID);
                    flag = true;
                    PublicModel.writeLog(SystemSet.EumLogType.DelData.ToString(),
                                         string.Concat("T_Construction_Project;key=", ConstructionProjectID, ";xmmc=", mdl.xmmc));
                }
            }
            return(flag);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try {
                #region 建设单位信息
                T_Company_MDL companyMDL = new T_Company_MDL();

                companyMDL              = Comm.GetValueToObject(companyMDL, table_Company) as T_Company_MDL;
                companyMDL.CreateDate   = DateTime.Now;
                companyMDL.IsCompany    = true;
                companyMDL.CreateIP     = Common.DNTRequest.GetIP();
                companyMDL.CreateUserID = 0;//公司创建人

                int companyID = companyBLL.Add(companyMDL);
                #endregion

                if (companyID > 0)
                {
                    #region 项目信息
                    T_Construction_Project_MDL cpModel = new T_Construction_Project_MDL();
                    T_Construction_Project_BLL cpBll   = new T_Construction_Project_BLL();

                    cpModel.CompanyID = companyID;                     //所属单位
                    cpModel.xmmc      = xmmc.Text;                     //项目名称
                    cpModel.xmh       = string.Empty;                  //项目号
                    if (jgsj.Text.Length > 0)
                    {
                        cpModel.jgrq = Common.ConvertEx.ToDate(jgsj.Text);  //开工时间
                    }
                    cpModel.jgsj        = jgsj.Text;
                    cpModel.ProjectType = ProjectType.SelectValue;
                    int constructionProjectID = cpBll.Add(cpModel);
                    #endregion

                    #region 工程信息
                    T_SingleProject_MDL singleProjectMDL = new T_SingleProject_MDL();

                    singleProjectMDL                       = Comm.GetValueToObject(singleProjectMDL, tablemain) as T_SingleProject_MDL;
                    singleProjectMDL.AREA_CODE             = AREA_CODE.SelectValue;
                    singleProjectMDL.ConstructionProjectID = constructionProjectID;
                    singleProjectMDL.CreateDate            = DateTime.Now;
                    singleProjectMDL.Status                = 0;                      //初始为0,未分配
                    singleProjectMDL.jsdw                  = companyMDL.CompanyName; //建设单位,是当前单位
                    singleProjectMDL.gcdd                  = gcdd.Text.Trim();
                    singleProjectMDL.WorkFlow_DoStatus     = 0;

                    int singleProjectID = singleProjectBLL.Add(singleProjectMDL); //工程ID
                    UploadFile(singleProjectID);                                  //上传证书

                    #endregion

                    #region 用户信息 ,角色默认给先前定义好的建设单位角色
                    T_UsersInfo_MDL userMDL = new T_UsersInfo_MDL();
                    userMDL               = (T_UsersInfo_MDL)Comm.GetValueToObject(userMDL, tLoginInfo);
                    userMDL.RoleID        = roleBLL.GetRoleIdByRoleCode(SystemSet._ROLECODE_JSCOMPANY, singleProjectMDL.AREA_CODE);
                    userMDL.Passwd        = DESEncrypt.Encrypt(Passwd.Text);
                    userMDL.UserType      = SystemSet.EumUserType.CompanyUser.ToString();
                    userMDL.UserName      = userMDL.LoginName;
                    userMDL.CompanyID     = companyID;
                    userMDL.Createdate    = DateTime.Now;
                    userMDL.LastLoginTime = DateTime.Now;
                    userMDL.IsLeader      = true;
                    userMDL.IsValid       = false;
                    userMDL.Createdby     = "工程报建产生";
                    int userID = userBLL.Add(userMDL);
                    #endregion

                    #region 添加工程用户关联信息
                    PublicModel.AddSingleProjectUser(singleProjectID, userMDL.RoleID, userID);
                    #endregion

                    #region 添加工程公司关联信息
                    PublicModel.AddSingleProjectCompany(singleProjectID, companyID);
                    #endregion

                    #region 添加工程流程环节
                    new T_WorkFlowDefine_BLL().AddWorkFlowDefine(singleProjectID, singleProjectMDL.AREA_CODE);
                    #endregion

                    #region 更新工程表的 CompanyUserID为当前建设单位用户ID
                    singleProjectMDL = singleProjectBLL.GetModel(singleProjectID);
                    singleProjectMDL.CompanyUserID = userID;
                    singleProjectBLL.Update(singleProjectMDL);
                    #endregion

                    #region 报建完成提示信息
                    this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "IsSuccess",
                                                                 "<script>"
                                                                 + " layer.alert('您已经成功注册,但您注册的信息,必需确认后才可以登录使用。请耐心等待,或致电:" + SystemSet._QUICKREGTEL + "', { btnAlign: 'c' }, function (i) {"
                                                                 + "     var index = parent.layer.getFrameIndex(window.name);"
                                                                 + "     parent.layer.close(index);"
                                                                 + "}); "
                                                                 + "</script>");
                    #endregion
                }
            } catch (Exception ex) {
                Common.LogUtil.Debug(this, "建设单位工程报建", ex);
                Common.MessageBox.FnLayerAlert(this.Page, "工程报建保存失败:" + ex.Message);
            }
        }
Ejemplo n.º 6
0
        private void DataBindEx()
        {
            T_Construction_Project_MDL projectmdl = (new T_Construction_Project_BLL()).GetModel(ConvertEx.ToInt(constructionprojectid.Value));

            Comm.SetValueToPage(projectmdl, table2);
        }