Пример #1
0
        public bool AddOrg(b01 org, b01Expansion orge)
        {
            CQGJPassportEntities CQGJ = new CQGJPassportEntities();
            orge.b01 = org;
            if (org.b0111 == orge.b01.b0111)
            {
                try
                {
                    CQGJ.AddTob01(org);
                    CQGJ.AddTob01Expansion(orge);

                    CQGJ.SaveChanges();
                    return true;
                }
                catch
                {

                }

            }
            return false;
        }
Пример #2
0
        public string ValidateOrg(string orgname, string password)
        {
            CQGJPassportEntities CQGJ = new CQGJPassportEntities();
            b01 Querry = new b01();
            string strResult = "";
            try
            {
                Querry = (from b in CQGJ.b01 where (b.b0101 == orgname || b.b0104 == orgname) select b).First();
                strResult = Querry.b0111;
            }
            catch
            {
                strResult = "";
            }
            if (strResult.Equals(""))
            {
                return strResult;
            }
            else
            {
                b01Expansion OrgOtherInfo = new b01Expansion();
                try
                {
                    OrgOtherInfo = (from i in CQGJ.b01Expansion where i.b01.b0111 == strResult && i.Password == password select i).First();
                }
                catch
                {
                    strResult = "";

                }
            }
            return strResult;
        }
Пример #3
0
 public bool SaveOrgChange(b01 Org, b01Expansion OrgEx)
 {
     OrgEx.b01 = Org;
     CQGJPassportEntities CQGJ = new CQGJPassportEntities();
     b01 newOrg = (from c in CQGJ.b01
                   where c.b0111 == Org.b0111
                   select c).First();
     b01Expansion newOrgEx = (from d in CQGJ.b01Expansion
                              where d.ID == OrgEx.ID
                              select d).First();
     newOrg.b0101 = Org.b0101;
     newOrgEx.Mail = OrgEx.Mail;
     newOrgEx.Mobile = OrgEx.Mobile;
     newOrgEx.Tel = OrgEx.Tel;
     if (newOrgEx.b01==newOrg)
     {
         int i= CQGJ.SaveChanges();
         return true;
     }
     return false;
 }
Пример #4
0
        public string GetOrgType(string orgcode)
        {
            CQGJPassportEntities CQGJ = new CQGJPassportEntities();
            b01Expansion OrgOtherInfo = new b01Expansion();
            string strResult = "";
            try
            {
                OrgOtherInfo = (from i in CQGJ.b01Expansion where i.b01.b0111 == orgcode select i).First();
                strResult = OrgOtherInfo.OrgType.ToString();
            }
            catch
            {
                strResult = "";

            }
            return strResult;
        }
Пример #5
0
        public void CreateOrg()
        {
            CQGJUserViewData viewData = new CQGJUserViewData();
            b01 Org = new b01();
            b01Expansion OrgE = new b01Expansion();

            int orgType = int.Parse(GetString("OrgType"));

            Org.b0101 = GetString("b0101");
            Org.b0104 = GetString("b0104");
            Org.b0107 = GetString("b0107");
            //Org.b0111 = GetString("b0111");
            Org.b0111_1 = GetString("b0111_1");
            Org.b0111_3 = GetString("b0111_3");
            Org.b0114 = GetString("b0114");
            Org.b0117 = GetString("b0117");
            Org.b01224 = GetString("b01224");
            Org.b0127 = GetString("b0127");
            Org.b0131 = GetString("b0131");
            Org.b0134 = GetString("b0134");
            Org.b0137 = GetString("b0137");
            Org.b0144_1 = GetString("b0144_1");
            Org.b0144_2 = GetString("b0144_2");
            Org.b0151_1 = GetString("b0151_1");
            Org.b0151_2 = GetString("b0151_2");
            Org.b0154_1 = GetString("b0154_1");
            Org.b0154_2 = GetString("b0154_2");
            Org.b0157_1 = GetString("b0157_1");
            Org.b0157_2 = GetString("b0157_2");
            Org.b0161 = GetString("b0161");
            Org.b0164 = GetDate("b0164");
            Org.b0167 = GetString("b0167");
            Org.b0171_1 = GetString("b0171_1");
            Org.b0171_2 = GetString("b0171_2");
            Org.b0174 = GetString("b0174");
            Org.b0177 = GetString("b0177");
            Org.b0181 = GetDate("b0181");
            Org.b0184 = GetString("b0184");
            Org.b0187_1 = GetString("b0187_1");
            Org.b0187_2 = GetString("b0187_2");
            Org.b0191 = GetString("b0191");
            Org.b0194 = GetString("b0194");
            Org.b0197 = GetString("b0197");
            Org.b0199 = GetString("b0199");
            if (orgType != 0)
            {
                Org.b0111 = GetString("b0111");
            }
            else
            {
                //Org.b0111 = GetString("b0111");
            }
            CQGJ.AddTob01(Org);
            CQGJ.SaveChanges(true);

            OrgE.b01 = Org;
            OrgE.Password = Security.MD5Encrypt("123456");
            OrgE.OrgType = orgType;
            CQGJ.AddTob01Expansion(OrgE);
            CQGJ.SaveChanges(true);

            viewData.ActionSuccess = true;
            viewData.HtmlPage = "单位:" + Org.b0104 + "添加成功。";
            viewData.JavaScriptPage = "/admin/OrgInfo/" + Org.b0111;

            //调用webservers
            CQGJAP.CQGJWebServices ap = new CQGJ.Passport.CQGJAP.CQGJWebServices();
            ap.AddOrg(Org.b0111);

            RenderView("MessagePage", viewData);
        }