Пример #1
0
        public void DocAdd(int? id)
        {
            //首先取得本单位的code 再取上下级别的单位
            DocAddViewData viewData = new DocAddViewData() { lsLowerorg2 = new List<b01>(), lsLowerorg4 = new List<b01>(), lsUpperOrg = new List<b01>(), lsWordNo = new List<string>(), ClassType = new Dictionary<string, string>(), Secret = new Dictionary<string, string>(), Emergercy = new Dictionary<string, string>(), DocClass = new Dictionary<string, string>(), DocType = new Dictionary<string, string>() };

            //取得所有的公文字号
            int orgID = GetOrgID();
            viewData.lsWordNo = (from c in CQGJ.DocWord
                                 where c.Org.OrgID == orgID
                                 select c.WordName).ToList();
            viewData.YearNo = DateTime.Now.Year.ToString();
            int StoredYearNo = Convert.ToInt32((from c in CQGJ.Doc
                                select c.YearNo).Max());
            if (Convert.ToInt32(viewData.YearNo) != StoredYearNo)
            {
                viewData.TeamNo = "1";
            }
            else
            {
                viewData.TeamNo = (Convert.ToInt32((from c in CQGJ.Doc
                                   select c.TeamNo).Max())+1).ToString();
            }
            viewData.SourceUnit= ((b01)HttpContext.Session["Org"]).b0101.ToString();

            //取得本地单位
            viewData.localOrg = (b01)(HttpContext.Session["Org"]);
            string orgIDstr = orgID.ToString();
            viewData.Draft = (from c in CQGJ.Doc
                              where c.SignMan == orgIDstr && c.Status == (int?)DocStatus.Draft
                              select c);
            ////取得下级单位列表
            passport.CQGJPassport cqgj = new CQGJ.passport.CQGJPassport();
            string orgCode = viewData.localOrg.b0111;
            //可以将本地单位码当成参数输入

            string strHtml = "";
            if (id == 1)
            {
                viewData.lsLowerorg2 = cqgjPassport.GetOrglistByType(2).ToList();
                viewData.lsLowerorg4 = cqgjPassport.GetOrglistByType(4).ToList();
                viewData.lsLowerOrg3 = cqgjPassport.GetOrglistByType(3).ToList();
                //CreateAllOwnedOrgHtml(ref strHtml, orgCode);
                viewData.Type = 1;
            }
            else if (id == 2)
            {
                viewData.lsUpperOrg = cqgjPassport.GetOrglistByType(1).ToList();
                viewData.Type = 2;
            }
            viewData.strHtml = strHtml;

            string[] secret = (ConfigurationManager.AppSettings.Get("Secret")).Split(',');
            string[] secretdetail = ConfigurationManager.AppSettings.Get("SecretDetail").Split(',');
            for (int i = 0; i < secret.Count(); i++)
            {
                viewData.Secret.Add(secret[i], secretdetail[i]);
            }

            string[] Emergercy = ConfigurationManager.AppSettings.Get("Emergercy").Split(',');
            string[] EmergercyDetail = ConfigurationManager.AppSettings.Get("EmergercyDetail").Split(',');
            for (int i = 0; i < Emergercy.Count(); i++)
            {
                viewData.Emergercy.Add(Emergercy[i], EmergercyDetail[i]);
            }

            string[] DocClass = ConfigurationManager.AppSettings.Get("DocClass").Split(',');
            string[] DocClassDetail = ConfigurationManager.AppSettings.Get("DocClassDetail").Split(',');
            for (int i = 0; i < DocClass.Count(); i++)
            {
                viewData.DocClass.Add(DocClass[i], DocClassDetail[i]);
            }

            string[] ClassType = ConfigurationManager.AppSettings.Get("ClassType").Split(',');
            string[] ClassTypeDetail = ConfigurationManager.AppSettings.Get("ClassTypeDetail").Split(',');
            for (int i = 0; i < ClassType.Count(); i++)
            {
                viewData.ClassType.Add(ClassType[i], ClassTypeDetail[i]);
            }

            string[] DocType = ConfigurationManager.AppSettings.Get("DocType").Split(',');
            string[] DocTypeDetail = ConfigurationManager.AppSettings.Get("DocTypeDetail").Split(',');
            for (int i = 0; i < DocType.Count(); i++)
            {
                viewData.DocType.Add(DocType[i], DocTypeDetail[i]);
            }
            RenderView("DocAdd", viewData);
        }
Пример #2
0
        /// <summary>
        /// 添加公文
        /// </summary>
        /// <param name="id"></param>        
        public ActionResult DocAdd(int? id)
        {
            //首先取得本单位的code 再取上下级别的单位
            DocAddViewData viewData = new DocAddViewData() { lsWordNo = new List<string>() };

            //取得所有的公文字号
            int orgID = GetOrg().OrgID;
            viewData.lsWordNo = (from c in CQGJ.DocWord
                                 where c.Org.OrgID == orgID
                                 select c.WordName).ToList();
            viewData.YearNo = DateTime.Now.Year.ToString();
            int StoredYearNo = Convert.ToInt32((from c in CQGJ.Doc
                                                select c.YearNo).Max());
            if (Convert.ToInt32(viewData.YearNo) != StoredYearNo)
            {
                viewData.TeamNo = "1";
            }
            else
            {
                viewData.TeamNo = (Convert.ToInt32((from c in CQGJ.Doc
                                                    select c.TeamNo).Max()) + 1).ToString();
            }
            viewData.SourceUnit = GetOrg().OrgName;

            //取得本地单位
            viewData.localOrg = GetOrg();
            string orgIDstr = orgID.ToString();
            viewData.Draft = (from c in CQGJ.Doc
                              where c.SignMan == orgIDstr && c.Status == (int?)DocStatus.Draft
                              select c);
            //取得下级单位列表
            string orgCode = viewData.localOrg.OrgCode;
            //可以将本地单位码当成参数输入

            string strHtml = "";
            if (id == 1)
            {
                viewData.lsLowerorg2 = from o in CQGJ.Org
                                       where o.OrgType == 2
                                       select o;
                viewData.lsLowerorg4 = from o in CQGJ.Org
                                       where o.OrgType == 4
                                       select o;
                viewData.lsLowerOrg3 = from o in CQGJ.Org
                                       where o.OrgType == 3
                                       select o;
                //CreateAllOwnedOrgHtml(ref strHtml, orgCode);
                viewData.Type = 1;
            }
            else if (id == 2)
            {
                viewData.lsUpperOrg = from o in CQGJ.Org
                                      where o.OrgType == 1
                                      select o;
                viewData.Type = 2;
            }
            viewData.strHtml = strHtml;
            viewData.SecretLevel = SecretLevelList(1);
            viewData.UrgentLevel = UrgentLevelList(1);
            viewData.DocClass = DocClassList(1);
            viewData.TrainType = TrainTypeList(1);
            viewData.DocType = DocTypeList(1);
            return View("DocAdd", viewData);
        }