public string Register(String Eemail, String Epassword)
        {
            string judge;
            OxcoderDataContext enterpriseDataContext = new OxcoderDataContext();
            Enterprise enterprise = new Enterprise();
            var query = from k in enterpriseDataContext.Enterprise
                        where k.Eemail == Eemail
                        select k;

            //返回Student表中的记录数
            var count = query.Count();
            if (count == 0)//如果有重复的
            {
                enterprise.Eemail = Eemail;
                enterprise.Epassword = Epassword;
                enterpriseDataContext.Enterprise.InsertOnSubmit(enterprise);
                enterpriseDataContext.SubmitChanges();
                judge = "注册成功";

            }
            else
            {
                judge = "该账号已经被注册";
            }

            return judge;
        }
        public string Login(string Eemail, string Epassword)
        {
            string judge;
            OxcoderDataContext enterpriseDataContext = new OxcoderDataContext();
            Enterprise enterprise = new Enterprise();
            var queryUser = from k in enterpriseDataContext.Enterprise
                        where k.Eemail == Eemail
                        select k;
            var countForUser = queryUser.Count();
            if (countForUser == 0)//如果没有这个用户
            {
                judge = "用户不存在";
            }
            else
            {
                var queryPassword = from k in enterpriseDataContext.Enterprise
                                    where k.Eemail == Eemail&&k.Epassword == Epassword
                                    select k;
                var countForPassword = queryUser.Count();
                if (countForPassword == 0)//如果密码错误
                {
                    judge = "密码错误";
                }
                else
                {
                    judge = "登录成功";
                }
            }

            return judge;
        }
Esempio n. 3
0
        public string Add(Enterprise Model)
        {
            Model.Addtime = DateTime.Now;
            Model.EIMG = Model.EIMG.TrimEnd("_1".ToCharArray());
            EnterpriseBll bll = new EnterpriseBll();

            return bll.Add(Model);
        }
 public ActionResult Edit(Enterprise model)
 {
     ReturnData<string> ret = new ReturnData<string>();
     Model.Enterprise check = ebll.GetModelById(model.ID);
     string img = model.EIMG;
     check.EIMG = img;
     check.TitleLogo = model.TitleLogo;
     check.Contact = model.Contact;
     check.ContactTel = model.ContactTel;
     check.AreasID = model.AreasID;
     check.Address = model.Address;
     ret = ebll.Update(check);
     if (ret.Status == true)
     {
         return Content(ret.Message);
     }
     return Content(ret.Message);
 }
Esempio n. 5
0
        public ActionResult Edit(Enterprise model)
        {
            ReturnData <string> ret = new ReturnData <string>();

            Model.Enterprise check = ebll.GetModelById(model.ID);
            string           img   = model.EIMG;

            check.EIMG       = img;
            check.TitleLogo  = model.TitleLogo;
            check.Contact    = model.Contact;
            check.ContactTel = model.ContactTel;
            check.AreasID    = model.AreasID;
            check.Address    = model.Address;
            ret = ebll.Update(check);
            if (ret.Status == true)
            {
                return(Content(ret.Message));
            }
            return(Content(ret.Message));
        }
Esempio n. 6
0
 public string Resume(Enterprise Model)
 {
     Model.Status = 0;
     return bll.UpdateStatus(Model);
 }
Esempio n. 7
0
 public string Close(Enterprise Model)
 {
     Model.Status = 2;
     return bll.UpdateStatus(Model);
 }
Esempio n. 8
0
        public string Pause(Enterprise Model)
        {
            Model.Status = 1;
            return bll.UpdateStatus(Model);

        }
 partial void DeleteEnterprise(Enterprise instance);
 partial void UpdateEnterprise(Enterprise instance);
 partial void InsertEnterprise(Enterprise instance);