Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    EntityData entity = DAL.EntityDAO.OBSDAO.GetStandard_UnitByCode(Request.QueryString["UnitCode"]);
                    if (entity.HasRecord())
                    {
                        this.parentUnit.Value = entity.GetString("ParentUnitCode");
                        EntityData entityParent = DAL.EntityDAO.OBSDAO.GetStandard_UnitByCode(this.parentUnit.Value);
                        if (entityParent.HasRecord())
                        {
                            this.parentUnitName.Value = entityParent.GetString("UnitName");
                        }
                        entityParent.Dispose();
                    }
                    entity.Dispose();

                    EntityData projectds = ProjectDAO.GetProjectByCode(Request.QueryString["ProjectCode"].ToString());
                    RmsPM.BLL.PageFacade.LoadSubjectSetSelect(this.sltSubjectSet, "");
                    this.sltSubjectSet.Value = projectds.GetString("SubjectSetCode");

                    projectds.Dispose();
                }
                catch (Exception ex)
                {
                    ApplicationLog.WriteLog(this.ToString(), ex, "读取项目信息错误");
                    Response.Write(Rms.Web.JavaScript.Alert(true, "读取项目信息错误"));
                }
            }
        }
Esempio n. 2
0
        public static string GetDevelopUnitByProject(string projectCode)
        {
            string text2;

            try
            {
                string text = "";
                if (projectCode == "")
                {
                    return(text);
                }
                EntityData projectByCode = ProjectDAO.GetProjectByCode(projectCode);
                if (projectByCode.HasRecord())
                {
                    text = projectByCode.GetString("DevelopUnit");
                }
                projectByCode.Dispose();
                text2 = text;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(text2);
        }
Esempio n. 3
0
        public static bool IsUseShortNameByProjectCode(string projectCode)
        {
            bool flag2;

            try
            {
                bool flag = false;
                if (projectCode == "")
                {
                    return(flag);
                }
                EntityData projectByCode = ProjectDAO.GetProjectByCode(projectCode);
                if (projectByCode.HasRecord())
                {
                    flag = projectByCode.GetString("IsUseShortName") == "1";
                }
                projectByCode.Dispose();
                flag2 = flag;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(flag2);
        }
Esempio n. 4
0
        public static string GetProjectShortName(string ProjectCode, bool WhenNullUseProjectName)
        {
            string text2;

            try
            {
                string text = "";
                if (ProjectCode == "")
                {
                    return(text);
                }
                EntityData projectByCode = ProjectDAO.GetProjectByCode(ProjectCode);
                if (projectByCode.HasRecord())
                {
                    text = projectByCode.GetString("ProjectShortName");
                    if ((text == "") && WhenNullUseProjectName)
                    {
                        text = projectByCode.GetString("ProjectName");
                    }
                }
                projectByCode.Dispose();
                text2 = text;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(text2);
        }
Esempio n. 5
0
        protected void btnSave_ServerClick(object sender, System.EventArgs e)
        {
            try
            {
                EntityData projectds = ProjectDAO.GetProjectByCode(Request.QueryString["ProjectCode"].ToString());

                projectds.CurrentRow["SubjectSetCode"] = this.sltSubjectSet.Value;
                DAL.EntityDAO.ProjectDAO.UpdateProject(projectds);
                //this.lblSubjectSet.Text = BLL.SubjectRule.GetSubjectSetName(projectds.GetString("SubjectSetCode"));

                EntityData entity = null;
                DataRow    dr     = null;
                entity = DAL.EntityDAO.OBSDAO.GetStandard_UnitByCode(Request.QueryString["UnitCode"]);
                dr     = entity.CurrentRow;

                if (this.parentUnit.Value == dr["UnitCode"].ToString())
                {
                    Response.Write(Rms.Web.JavaScript.Alert(true, "不能将部门设置为自身的子部门 !"));
                    entity.Dispose();
                    return;
                }
                EntityData parent     = DAL.EntityDAO.OBSDAO.GetUnitByCode(this.parentUnit.Value);
                int        parentDeep = parent.GetInt("Deep");
                dr["ParentUnitCode"] = this.parentUnit.Value;
                dr["Deep"]           = parentDeep + 1;
                dr["FullCode"]       = parent.GetString("FullCode") + "-" + dr["UnitCode"].ToString();

                DAL.EntityDAO.OBSDAO.SubmitAllStandard_Unit(entity);
                entity.Dispose();
                projectds.Dispose();

                Response.Write(Rms.Web.JavaScript.ScriptStart);
                if (this.txtRefreshScript.Value.Trim() != "")
                {
                    Response.Write("window.opener." + this.txtRefreshScript.Value.Trim());
                }
                else
                {
                    Response.Write(Rms.Web.JavaScript.OpenerReload(false));
                    Response.Write("window.opener.parent.frames['Left'].location.reload();");
                }

                Response.Write(Rms.Web.JavaScript.WinClose(false));
                Response.Write(Rms.Web.JavaScript.ScriptEnd);
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "保存项目信息错误");
                Response.Write(Rms.Web.JavaScript.Alert(true, "保存项目信息错误"));
            }
        }
Esempio n. 6
0
        private void LoadData()
        {
            string unitCode = Request["UnitCode"] + "";

            try
            {
                EntityData ds = OBSDAO.GetStandard_UnitByCode(unitCode);

                if (ds.HasRecord())
                {
                    this.lblSortID.Text   = ds.GetString("SortID");
                    this.lblUnitType.Text = ds.GetString("UnitType");

                    this.lblName.Text      = ds.GetString("UnitName");
                    this.lblPrincipal.Text = BLL.SystemRule.GetUserName(ds.GetString("Principal"));
                    this.lblRemark.Text    = ds.GetString("Remark");
                    //this.lblSubjectSet.Text = BLL.SubjectRule.GetSubjectSetName(ds.GetString("SubjectSetCode"));
                    if (ds.GetInt("SelfAccount") == 1)
                    {
                        this.lblSelfAccount.Text = "独立核算";
                    }

                    //显示财务编码
                    this.lblSubjectSetDesc.Text = BLL.FinanceRule.GetFinanceSubjectSetDesc(ds.Tables["UnitSubjectSet"]);

                    if (ds.GetString("UnitType") == "项目")
                    {
                        this.btnDelete.Visible = false;
                        //this.btnModify.Visible = false;
                        //this.trToolBar.Style["display"] = "none";
                        btnModify.Attributes["onclick"] = "javascript:ModifyProject(" + ds.GetString("RelaCode") + ");return false;";
                        EntityData projectds = ProjectDAO.GetProjectByCode(ds.GetString("RelaCode"));
                        this.lblSubjectSet.Text = BLL.SubjectRule.GetSubjectSetName(projectds.GetString("SubjectSetCode"));
                    }
                    else
                    {
                        //如果是部门则隐掉帐套
                        lblSubjectsettd.Visible  = false;
                        lblSelfAccount.Visible   = false;
                        lblSubjectSet.Visible    = false;
                        tdsubjectsetdesc.ColSpan = 3;
                    }
                }
                ds.Dispose();



                EntityData childUnit = DAL.EntityDAO.OBSDAO.GetOBSUnitByParent(unitCode);
                this.dgListChildUnit.DataSource = childUnit;
                this.dgListChildUnit.DataBind();
                childUnit.Dispose();

                EntityData station = DAL.EntityDAO.OBSDAO.GetStationByUnitCode(unitCode);
                station.CurrentTable.Columns.Add("RoleLevelName");
                int iCount = station.CurrentTable.Rows.Count;
                for (int i = 0; i < iCount; i++)
                {
                    station.SetCurrentRow(i);
                    int roleLevel = station.GetInt("RoleLevel");
                    station.CurrentRow["RoleLevelName"] = BLL.SystemRule.GetRoleLevelName(roleLevel);
                }

                this.dgConfig.DataSource = station;
                this.dgConfig.DataBind();
                station.Dispose();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "显示出错:" + ex.Message));
            }
        }