Beispiel #1
0
    private void SaveJob()
    {
        BLL.UserBLL userbll = new BLL.UserBLL();

        BLL.JobBLL bll   = new BLL.JobBLL();
        JobModel   model = new JobModel();

        model.JobId = ReStr("JobId", "");

        if (userbll.HasPower(model.JobId))
        {
            //如果没有权限发布
        }
        else
        {
            ReTrue();
        }

        if (model.JobId.Trim() != "")
        {    //修改
            model = bll.GetJobModel(model.JobId);
            if (model.CreateUser == Common.CookieSings.GetCurrentUserId())
            {
            }
            else
            {
                if (!userbll.IsAdministrator())
                {
                    throw new Exception("您没有权限执行此操作!");
                }
            }
        }
        else
        {
            model.RecommendLv = ReInt("RecommendLv", 0);
        }
        model.HumNum       = ReInt("HumNum");
        model.ContactEmail = ReStr("ContactEmail");
        model.ContactName  = ReStr("ContactName");
        model.ContactPhone = ReStr("ContactPhone", "");
        model.ContactQQ    = ReStr("ContactQQ", "");
        model.ContactTell  = ReStr("ContactTell", "");
        model.HumNum       = ReInt("HumNum", 0);
        model.IsTop        = ReBool("IsTop", false);
        model.JobMemo      = ReStr("JobMemo");
        model.JobPayId     = ReInt("JobPayId");
        model.JobtTitle    = ReStr("JobtTitle");
        model.JobTypeId    = ReInt("JobTypeId");
        model.MerchantId   = ReDecimal("MerchantId", 0);
        model.SchoolExpId  = ReInt("SchoolExpId");
        model.Sex          = ReStr("Sex");
        model.WorkYearId   = ReInt("WorkYearId");
        model.JobLat       = ReDecimal("JobLat", 0);
        model.JobLng       = ReDecimal("JobLng", 0);
        model.TownId       = ReDecimal("TownId");
        bll.SaveJob(model);

        ReDict2.Add("JobId", model.JobId);
        ReTrue();
    }
Beispiel #2
0
    private void SaveHouseDemand()
    {
        BLL.UserBLL            ubll  = new BLL.UserBLL();
        Model.HouseDemandModel model = new Model.HouseDemandModel();
        model.HouseDemandId     = ReStr("HouseDemandId", "");
        model.HouseDemandTitle  = ReStr("HouseDemandTitle", "");
        model.HouseDemandTypeId = ReInt("HouseDemandTypeId", 0);
        model.BeginPrice        = ReDecimal("BeginPrice", 0);
        model.EndPrice          = ReDecimal("EndPrice", 0);
        model.Hshi            = ReInt("Hshi", 0);
        model.Hting           = ReInt("Hting", 0);
        model.Hchu            = ReInt("Hchu", 0);
        model.Hwei            = ReInt("Hwei", 0);
        model.Hyangtai        = ReInt("Hyangtai", 0);
        model.HouseDemandMemo = ReStr("HouseDemandMemo");
        model.ContactName     = ReStr("ContactName");
        model.ContactTell     = ReStr("ContactTell");
        model.ContactPhone    = ReStr("ContactPhone");
        model.ContactEmail    = ReStr("ContactEmail");
        model.ContactQQ       = ReStr("ContactQQ");
        model.CommunityTitle  = ReStr("CommunityTitle");
        model.CommunityId     = ReInt("CommunityId", 0);
        model.TownId          = ReInt("TownId", 0);

        model.CreateUser = ubll.CurrentUserId();


        BLL.HouseBLL bll = new BLL.HouseBLL();
        bll.SaveHouseDemand(model);

        ReDict2.Add("HouseDemandId", model.HouseDemandId);

        ReTrue();
    }
Beispiel #3
0
        protected void ImageButton_submit_Click(object sender, ImageClickEventArgs e)
        {
            if (check())
            {
                StaffBLL staffBLL = new StaffBLL();
                UserBLL userBLL = new UserBLL();

                string username = TextBox_username.Text.Trim();
                string name = TextBox_name.Text.Trim();
                string gender = RadioButton_male.Checked ? "男" : "女";
                string birth = DropDownList_yearPart1.SelectedValue + DropDownList_yearPart2.SelectedValue + DropDownList_yearPart3.SelectedValue + DropDownList_yearPart4.SelectedValue;
                birth += DropDownList_month.SelectedValue;
                string phone = TextBox_phone.Text.Trim();
                string type = DropDownList_type.SelectedValue;

                User user = userBLL.get(staff.UserId);
                if (!user.UserName.Equals(username) || !staff.Type.Equals(type))
                {
                    user.UserName = username;
                    user.Type = type.Equals("考勤维护员") ? "6" : "5";
                    userBLL.update(user);
                }

                staff.Name = name;
                staff.Gender = gender;
                staff.Birth = birth;
                staff.Phone = phone;
                staff.Type = type;
                staffBLL.update(staff);

                Response.Write("<script>alert('修改成功!');location.href='showStaffs.aspx';</script>");

            }
        }
Beispiel #4
0
        protected void ImageButton_submit_Click(object sender, ImageClickEventArgs e)
        {
            if (check())
            {
                TeacherBLL teachBLL = new TeacherBLL();

                string name = TextBox_name.Text.Trim();
                string gender = RadioButton_male.Checked ? "男" : "女";
                string birth = DropDownList_yearPart1.SelectedValue + DropDownList_yearPart2.SelectedValue + DropDownList_yearPart3.SelectedValue + DropDownList_yearPart4.SelectedValue;
                birth += DropDownList_month.SelectedValue;
                string title = DropDownList_title.SelectedValue;
                string phone = TextBox_phone.Text.Trim();
                string email = TextBox_email.Text.Trim();

                if (!teacher.Title.Equals(title))
                {
                    UserBLL userBLL = new UserBLL();
                    User user = userBLL.get(teacher.UserID);
                    user.Type = title.Equals("辅导员") ? "2" : "1";
                    userBLL.update(user);
                }

                teacher.Name = name;
                teacher.Gender = gender;
                teacher.Birth = birth;
                teacher.Title = title;
                teacher.Phone = phone;
                teacher.Email = email;

                teachBLL.update(teacher);

                Response.Write("<script>alert('修改成功!');location.href='showTeachers.aspx';</script>");

            }
        }
Beispiel #5
0
    /// <summary>
    /// 投递简历
    /// </summary>
    private void SubResume()
    {
        BLL.JobBLL  bll  = new BLL.JobBLL();
        BLL.UserBLL ubll = new BLL.UserBLL();
        DataTable   dt   = bll.GetResumeList(" CreateUser='******' ");

        if (dt.Rows.Count == 0)
        {
            throw new Exception("您还没有简历请先创建一份简历!");
        }
        else
        {
            DataRow dr = dt.Rows[0];
            Model.ResumeVsJobModel model = new ResumeVsJobModel();
            model.JobId    = ReStr("JobId");
            model.Memo     = "";
            model.ResumeId = dr["ResumeId"].ToString();
            model.VsType   = "正常投递";
            try
            {
                bll.SubResume(model);
            }
            catch
            {
                throw new Exception("投递错误! 您是否已经投递了此职位?!");
            }
            ReTrue();
        }
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            
            
            string username = Request.Form["username"];
            string pwd = Request.Form["pwd"];
            UserInfo us = new UserInfo();
            us.PassWord = pwd;
            us.UserName = username;
            UserBLL ub = new UserBLL();
            UserInfo row = ub.FindUser(us);
            if (string.IsNullOrEmpty(row.PassWord))
            {
                Response.Redirect("Login.aspx?p=1");

                ////说明没有用户
                //Response.Write("<script type=\"text/javascript\">alert(\"用户名或密码错误!\");</script>");

            }
            else
            {
                //登陆成功 将用户存入session
                Session["username"] = row.UserName;
                Response.Redirect("ShowAllVideo.aspx");
                

            }



        }
Beispiel #7
0
        protected void Button_submit_Click(object sender, EventArgs e)
        {
            if (!checkEmpty())
            {
                string userName = TextBox_userName.Text.Trim();
                string password = TextBox_password.Text.Trim();

                StaffBLL staffBLL = new StaffBLL();
                UserBLL userBLL = new UserBLL();
                User user = userBLL.getByUsername(userName);
                if (user != null)
                {
                    //取得加密后的密码
                    string encryptPWD = EncryptUtil.MD5Encrypt(password);

                    if (!user.Password.Equals(encryptPWD))
                    {
                        //密码不匹配的情况

                        checkPassword.ErrorMessage = "密码输入错误!";
                        checkPassword.IsValid = false;

                    }
                    else
                    {
                        Staff staff = staffBLL.getByUserId(user.Id);
                        if (staff != null && staff.Type.Equals("超级管理员"))
                        {

                            //用户检查通过的情况
                            AttendanceBLL attendBLL = new AttendanceBLL();
                            CourseTableBLL ctBLL = new CourseTableBLL();

                            string filter = "semester='" + GlobalVars.SEMESTER + "'";
                            DataTable dt = PageUtil.getProcessedDataTable(ctBLL.getAll().Tables[0], filter, null, false);

                            foreach (DataRow dr in dt.Rows)
                            {
                                attendBLL.deleteByCourseTableId(dr["ID"].ToString());
                            }

                            Response.Write("<script>alert('考勤初始化成功!');location.href='../mainPages/welcome.aspx';</script>");

                        }
                        else
                        {
                            checkUsername.ErrorMessage = "该用户没有权限!";
                            checkUsername.IsValid = false;
                        }

                    }
                }
                else
                {
                    checkUsername.ErrorMessage = "账号不存在!";
                    checkUsername.IsValid = false;
                }
            }
        }
Beispiel #8
0
 public static UserBLL GetUserBLL()
 {
     if (instance == null)
     {
         instance = new UserBLL();
     }
     return instance;
 }
Beispiel #9
0
        protected void ImageButton_submit_Click(object sender, ImageClickEventArgs e)
        {
            if (check())
            {
                ClassBLL classBLL = new ClassBLL();
                StudentBLL stuBLL = new StudentBLL();
                UserBLL userBLL = new UserBLL();

                string stuId = TextBox_stuId.Text.Trim();
                string name = TextBox_name.Text.Trim();
                string gender = RadioButton_male.Checked ? "男" : "女";
                string birth = DropDownList_yearPart1.SelectedValue + DropDownList_yearPart2.SelectedValue + DropDownList_yearPart3.SelectedValue + DropDownList_yearPart4.SelectedValue;
                birth += DropDownList_month.SelectedValue;
                string phone = TextBox_phone.Text.Trim();
                string address = TextBox_address.Text.Trim();
                string classID = DropDownList_class.SelectedValue;

                if (stuBLL.getByStuId(stuId) == null)
                {
                    if (userBLL.getByUsername(stuId) == null)
                    {
                        #region 在用户表中创建新用户
                        User user = new User();
                        user.UserName = stuId;
                        user.Password = EncryptUtil.MD5Encrypt("12345678");
                        user.Type = "4";
                        userBLL.save(user);
                        #endregion

                        Class clazz = classBLL.get(classID);
                        clazz.StudCount = (Convert.ToInt32(clazz.StudCount) + 1).ToString();
                        classBLL.update(clazz);

                        Student stu = new Student();
                        stu.StuId = stuId;
                        stu.Name = name;
                        stu.Gender = gender;
                        stu.Birth = birth;
                        stu.Phone = phone;
                        stu.Address = address;
                        stu.ClassID = classID;
                        stu.UserID = userBLL.getByUsername(stuId).Id;

                        stuBLL.save(stu);
                        Response.Write("<script>alert('添加成功!');location.href='addStudent.aspx';</script>");
                    }
                    else
                        Response.Write("<script>alert('添加失败,用户名已存在!');location.href='addStudent.aspx';</script>");
                }
                else
                {
                    checkStuId.ErrorMessage = "学号已存在!";
                    checkStuId.IsValid = false;
                }

            }
        }
Beispiel #10
0
        public string Login(dynamic obj)
        {
            Common.JsonResult <string> jsonresult = new Common.JsonResult <string>();

            string codes     = Convert.ToString(obj.code);
            string appids    = ConfigurationManager.GetAppsettings("Appsettings:appid");
            string appscret  = ConfigurationManager.GetAppsettings("Appsettings:AppSecret");
            string granttype = ConfigurationManager.GetAppsettings("Appsettings:grant_type");

            string url = string.Format("https://api.weixin.qq.com/sns/jscode2session?appid={0}&secret={1}&js_code={2}&grant_type={3}", appids, appscret, codes, granttype);

            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);

            request.Method = "Post";
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();

            // 接收数据
            Stream       dataStream         = response.GetResponseStream();
            StreamReader reader             = new StreamReader(dataStream);
            string       responseFromServer = reader.ReadToEnd();
            WxAuthor     wx = Newtonsoft.Json.JsonConvert.DeserializeObject <WxAuthor>(responseFromServer);

            if (wx != null && wx.errcode == 0)
            {
                User user = new User
                {
                    OpenId      = wx.openid,
                    Seesion_Key = wx.session_key,
                    NickName    = Convert.ToString(obj.nickName),
                    Province    = Convert.ToString(obj.province),
                    City        = Convert.ToString(obj.city),
                    Gender      = Convert.ToString(obj.gender) == "1" ? "男" : "女",
                };
                //插叙数据库中保存

                int result = new BLL.UserBLL().InsertUserInfo(user);

                if (result == 1)
                {
                    jsonresult.Code = 100;
                    jsonresult.Msg  = "成功";
                }
                else
                {
                    jsonresult.Code = -1;
                    jsonresult.Msg  = "失败";
                }
            }
            else
            {
                jsonresult.Code = -2;
                jsonresult.Msg  = "获取信息失败";
            }
            string returnjson = Newtonsoft.Json.JsonConvert.SerializeObject(jsonresult);

            return(returnjson);
        }
Beispiel #11
0
        protected void ImageButton_submit_Click(object sender, ImageClickEventArgs e)
        {
            if (check())
            {

                TeacherBLL teachBLL = new TeacherBLL();
                UserBLL userBLL = new UserBLL();

                string teachId = TextBox_teachId.Text.Trim();
                string name = TextBox_name.Text.Trim();
                string gender = RadioButton_male.Checked ? "男" : "女";
                string birth = DropDownList_yearPart1.SelectedValue + DropDownList_yearPart2.SelectedValue + DropDownList_yearPart3.SelectedValue + DropDownList_yearPart4.SelectedValue;
                birth += DropDownList_month.SelectedValue;
                string title = DropDownList_title.SelectedValue;
                string phone = TextBox_phone.Text.Trim();
                string email = TextBox_email.Text.Trim();

                if (teachBLL.getByTeacherId(teachId) == null)
                {
                    if (userBLL.getByUsername(teachId) == null)
                    {
                        #region 在用户表中创建新用户
                        User user = new User();
                        user.UserName = teachId;
                        user.Password = EncryptUtil.MD5Encrypt("12345678");
                        user.Type = title.Equals("辅导员") ? "2" : "1";
                        userBLL.save(user);
                        #endregion

                        Teacher teacher = new Teacher();
                        teacher.TeacherId = teachId;
                        teacher.Name = name;
                        teacher.Gender = gender;
                        teacher.Birth = birth;
                        teacher.Title = title;
                        teacher.Phone = phone;
                        teacher.Email = email;
                        teacher.UserID = userBLL.getByUsername(teachId).Id;

                        teachBLL.save(teacher);
                        Response.Write("<script>alert('添加成功!');location.href='addTeacher.aspx';</script>");
                    }
                    else
                        Response.Write("<script>alert('添加失败,用户名已存在!');location.href='addTeacher.aspx';</script>");
                }
                else
                {
                    checkTeachId.ErrorMessage = "教师号已存在!";
                    checkTeachId.IsValid = false;
                }

            }
        }
Beispiel #12
0
    private void CheckSubResume()
    {
        BLL.JobBLL  bll  = new BLL.JobBLL();
        BLL.UserBLL ubll = new BLL.UserBLL();
        DataTable   dt   = bll.GetSubResumeList(" JobId='" + ReStr("JobId") + "' AND CreateUser='******'  ");

        if (dt.Rows.Count > 0)
        {
            throw new Exception("你已经投递了这份职位!");
        }
        else
        {
            ReTrue();
        }
    }
Beispiel #13
0
        protected void ImageButton_delete_Click(object sender, ImageClickEventArgs e)
        {
            ImageButton imageButton = sender as ImageButton;

            string id = imageButton.CommandArgument;

            TeacherBLL teachBLL = new TeacherBLL();
            UserBLL userBLL = new UserBLL();

            Teacher teacher = teachBLL.get(id);
            User user = userBLL.get(teacher.UserID);

            teachBLL.delete(teacher);
            userBLL.delete(user);

            Response.Write("<script>alert('删除成功!');location.href='showTeachers.aspx';</script>");
        }
Beispiel #14
0
        protected void ImageButton_delete_Click(object sender, ImageClickEventArgs e)
        {
            ImageButton imageButton = sender as ImageButton;

            string id = imageButton.CommandArgument;

            StaffBLL staffBLL = new StaffBLL();
            UserBLL userBLL = new UserBLL();

            Staff staff = staffBLL.get(id);
            User user = userBLL.get(staff.UserId);

            staffBLL.delete(staff);
            userBLL.delete(user);

            Response.Write("<script>alert('删除成功!');location.href='showStaffs.aspx';</script>");
        }
Beispiel #15
0
        protected void Button_submit_Click(object sender, EventArgs e)
        {
            if (!checkEmpty())
            {
                string oldPSD = TextBox_oldPWD.Text.Trim();
                string newPSD1 = TextBox_newPSD1.Text.Trim();
                string newPSD2 = TextBox_newPSD2.Text.Trim();

                UserBLL userBLL = new UserBLL();

                User user = Session["User"] as User;

                if (newPSD1.Equals(newPSD2))
                {
                    //新密码和确定密码相同的情况

                    //取得加密后的密码
                    string encryptPWD = EncryptUtil.MD5Encrypt(oldPSD);

                    if (!user.Password.Equals(encryptPWD))
                    {
                        //当前密码不匹配的情况

                        checkOldPWD.ErrorMessage = "当前密码输入错误!";
                        checkOldPWD.IsValid = false;

                    }
                    else
                    {
                        user.Password = EncryptUtil.MD5Encrypt(newPSD1);
                        userBLL.update(user);

                        Response.Write("<script>alert('密码修改成功!');location = 'logout.aspx';</script>");
                    }
                }
                else
                {
                    //新密码和确定密码不相同的情况

                    checkNewPWD2.ErrorMessage = "两次输入密码不一致!";
                    checkNewPWD2.IsValid = false;

                }
            }
        }
Beispiel #16
0
        protected void ImageButton_submit_Click(object sender, ImageClickEventArgs e)
        {
            if (check())
            {

                StaffBLL staffBLL = new StaffBLL();
                UserBLL userBLL = new UserBLL();

                string username = TextBox_username.Text.Trim();
                string name = TextBox_name.Text.Trim();
                string gender = RadioButton_male.Checked ? "男" : "女";
                string birth = DropDownList_yearPart1.SelectedValue + DropDownList_yearPart2.SelectedValue + DropDownList_yearPart3.SelectedValue + DropDownList_yearPart4.SelectedValue;
                birth += DropDownList_month.SelectedValue;
                string phone = TextBox_phone.Text.Trim();
                string type = DropDownList_type.SelectedValue;

                if (userBLL.getByUsername(username) == null)
                {
                    #region 在用户表中创建新用户
                    User user = new User();
                    user.UserName = username;
                    user.Password = EncryptUtil.MD5Encrypt("12345678");
                    user.Type = type.Equals("考勤维护员") ? "6" : "5";
                    userBLL.save(user);
                    #endregion

                    Staff staff = new Staff();
                    staff.Name = name;
                    staff.Gender = gender;
                    staff.Birth = birth;
                    staff.Phone = phone;
                    staff.Type = type;
                    staff.UserId = userBLL.getByUsername(username).Id;

                    staffBLL.save(staff);
                    Response.Write("<script>alert('添加成功!');location.href='addStaff.aspx';</script>");
                }
                else
                    Response.Write("<script>alert('添加失败,用户名已存在!');location.href='addStaff.aspx';</script>");
            }
        }
Beispiel #17
0
        private void bind()
        {
            string id = Request.QueryString["id"].ToString();

            StaffBLL staffBLL = new StaffBLL();
            staff = staffBLL.get(id);

            UserBLL userBLL = new UserBLL();
            User user = userBLL.get(staff.UserId);

            TextBox_username.Text = user.UserName;
            TextBox_name.Text = staff.Name;
            if (staff.Gender.Equals("女")) RadioButton_female.Checked = true;
            PageUtil.bindDropDownList(DropDownList_yearPart1, staff.Birth[0].ToString());
            PageUtil.bindDropDownList(DropDownList_yearPart2, staff.Birth[1].ToString());
            PageUtil.bindDropDownList(DropDownList_yearPart3, staff.Birth[2].ToString());
            PageUtil.bindDropDownList(DropDownList_yearPart4, staff.Birth[3].ToString());
            PageUtil.bindDropDownList(DropDownList_month, staff.Birth.Substring(4, 2));
            TextBox_phone.Text = staff.Phone;
            PageUtil.bindDropDownList(DropDownList_type, staff.Type);
        }
Beispiel #18
0
        protected void ImageButton_delete_Click(object sender, ImageClickEventArgs e)
        {
            ImageButton imageButton = sender as ImageButton;

            string id = imageButton.CommandArgument;

            ClassBLL classBLL = new ClassBLL();
            StudentBLL stuBLL = new StudentBLL();
            UserBLL userBLL = new UserBLL();

            Student stu = stuBLL.get(id);
            User user = userBLL.get(stu.UserID);

            stuBLL.delete(stu);
            userBLL.delete(user);

            Class clazz = classBLL.get(stu.ClassID);
            clazz.StudCount = (Convert.ToInt32(clazz.StudCount) - 1).ToString();
            classBLL.update(clazz);

            Response.Write("<script>alert('删除成功!');location.href='showStudents.aspx';</script>");
        }
Beispiel #19
0
    private void GetMyResumeInfo()
    {
        BLL.UserBLL ubll   = new BLL.UserBLL();
        string      UserId = ubll.CurrentUserId();



        BLL.JobBLL bll = new BLL.JobBLL();



        DataSet ds = bll.GetResumeListByUserId(UserId);

        string resumeJson      = JsonHelper.ToJsonNo1(ds.Tables[0]);
        string resumeVsJobType = JsonHelper.ToJson(ds.Tables[1]);
        string Education       = JsonHelper.ToJson(ds.Tables[2]);

        ReDict.Add("resumeJson", resumeJson);               //简历主体
        ReDict.Add("resumeVsJobTypeList", resumeVsJobType); //意向职位列表
        ReDict.Add("EducationList", Education);             //教育工作经历列表
        ReTrue();
    }
Beispiel #20
0
    private void SaveHouse()
    {
        Model.HouseModel model = new Model.HouseModel();
        BLL.HouseBLL     bll   = new BLL.HouseBLL();
        BLL.UserBLL      ubll  = new BLL.UserBLL();



        model.HouseId = ReStr("HouseId");
        if (model.HouseId != "")
        {
            model            = bll.GetHouseModel(model.HouseId);
            model.CreateTime = DateTime.Now;
        }
        else
        {
            model.CreateUser = ubll.CurrentUserId();       //如果是新增, 则给CreateUser赋值
        }

        model.HouseTitle     = ReStr("HouseTitle", "");
        model.HouseAddress   = ReStr("HouseAddress", "");
        model.Hshi           = ReInt("Hshi", 0);
        model.Hting          = ReInt("Hting", 0);
        model.Hchu           = ReInt("Hchu", 0);
        model.Hwei           = ReInt("Hwei", 0);
        model.Hyangtai       = ReInt("Hyangtai", 0);
        model.HouseModelId   = ReInt("HouseModelId", 0);
        model.DecorationId   = ReInt("DecorationId", 0);
        model.PropertyTypeId = ReInt("PropertyTypeId", 0);
        model.HouseClassId   = ReInt("HouseClassId", 0);
        model.Floor          = ReInt("Floor", 0);
        model.FloorALL       = ReInt("FloorALL", 0);
        model.HouseTypeId    = ReInt("HouseTypeId", 0);
        model.Rent           = ReDecimal("Rent");
        model.Price          = ReDecimal("Price");
        model.IsAgency       = ReBool("IsAgency");
        model.Device         = ReStr("Device");
        model.Memo           = ReStr("Memo", "");
        model.CreateTime     = DateTime.Now;

        model.PingFang       = ReDecimal("PingFang");
        model.ChaoXiangId    = ReInt("ChaoXiangId", 0);
        model.HouseImgId     = ReStr("HouseImgId", "");
        model.ContactName    = ReStr("ContactName");
        model.ContactTell    = ReStr("ContactTell");
        model.ContactPhone   = ReStr("ContactPhone");
        model.ContactEmail   = ReStr("ContactEmail");
        model.ContactQQ      = ReStr("ContactQQ");
        model.CommunityTitle = ReStr("CommunityTitle", "");
        model.CommunityId    = ReInt("CommunityId", 0);
        model.TownId         = ReDecimal("TownId", 0);
        model.HouseLat       = ReDecimal("HouseLat");
        model.HouseLng       = ReDecimal("HouseLng");
        model.RecommendLv    = ReInt("RecommendLv", 0);
        DataTable dt = DataSetting.CXmlToDatatTable(ReStr("HouseAllImgHtmlStr"));

        #region 事务开启
        TransactionOptions transactionOption = new TransactionOptions();
        transactionOption.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
        using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOption))
        {
            #endregion
            bll.SaveHouse(model);

            bll.DeleteHouseByHouseId(model.HouseId);
            if (dt != null)
            {
                //有图片上传
                Model.HouseVsImgModel HvI = new Model.HouseVsImgModel();

                foreach (DataRow dr in dt.Rows)
                {
                    HvI.HouseId = model.HouseId;
                    HvI.ImgId   = dr["ImgId"].ToString();
                    HvI.Memo    = "UE";
                    HvI.VsType  = "房源图片";
                    bll.AddHouseVsImg(HvI);
                }
            }

            //推广开始

            if (model.RecommendLv > 0)
            {
            }


            #region 事务关闭
            transactionScope.Complete();
        }
        #endregion
        ReDict2.Add("HouseId", model.HouseId);
        ReTrue();
    }
Beispiel #21
0
        protected void Button_submit_Click(object sender, EventArgs e)
        {
            if (!checkEmpty())
            {
                string userName = TextBox_userName.Text.Trim();
                string password = TextBox_password.Text.Trim();
                string userType = DropDownList_userType.SelectedValue;

                UserBLL userBLL = new UserBLL();
                User user = userBLL.getByUsername(userName);
                if (user != null)
                {
                    //取得加密后的密码
                    string encryptPWD = EncryptUtil.MD5Encrypt(password);

                    if (!user.Password.Equals(encryptPWD))
                    {
                        //密码不匹配的情况

                        checkPassword.ErrorMessage = "密码输入错误!";
                        checkPassword.IsValid = false;

                    }
                    else if (!user.Type.Equals("3-4") && !user.Type.Equals(userType))
                    {
                        //处理用户不是班长类型的情况

                        //用户类型不匹配的情况

                        checkUserType.ErrorMessage = "用户类型不匹配!";
                        checkUserType.IsValid = false;
                    }
                    else
                    {
                        if (user.Type.Equals("3-4"))
                        {
                            //处理用户类型是班长的情况

                            if (userType.Equals("3"))
                            {
                                user.Type = "3";
                            }
                            else if (userType.Equals("4"))
                            {
                                user.Type = "4";
                            }
                            else
                            {
                                //用户类型不匹配的情况

                                checkUserType.ErrorMessage = "用户类型不匹配!";
                                checkUserType.IsValid = false;
                                return;
                            }
                        }

                        //用户检查通过的情况

                        Session.Add("User", user);
                        Response.Redirect("~/mainPages/index.aspx");

                    }
                }
                else
                {
                    checkUsername.ErrorMessage = "账号不存在!";
                    checkUsername.IsValid = false;
                }
            }
        }
Beispiel #22
0
    private void SaveResume()
    {
        BLL.UserBLL uBll  = new BLL.UserBLL();
        ResumeModel model = new ResumeModel();

        BLL.JobBLL bll = new BLL.JobBLL();

        model.CreateUser = uBll.CurrentUserId();
        DataTable dtResumeByUser = bll.GetResumeList(" CreateUser='******' ");

        if (dtResumeByUser.Rows.Count > 0)
        {    //这个用户已经有简历了
            DataRow dr = dtResumeByUser.Rows[0];
            model.ResumeId = dr["ResumeId"].ToString();
        }
        else
        {
            //还没有创建简历
            model.ResumeId = ReStr("ResumeId").Trim();     //传过来一般也是空的
        }
        model.IsTop       = false;
        model.JobPayId    = ReInt("JobPayId");
        model.ResumeAge   = ReInt("ResumeAge");
        model.ResumeEmail = ReStr("ResumeEmail");
        model.JobTarget   = ReStr("JobTarget");
        model.ResumeMemo  = ReStr("ResumeMemo");
        model.ResumeName  = ReStr("ResumeName");
        model.ResumeQQ    = ReStr("ResumeQQ");
        model.ResumeSex   = ReStr("ResumeSex");
        model.ResumeTell  = ReStr("ResumeTell");
        model.SchoolExp   = ReInt("SchoolExp");
        model.TopLv       = ReInt("TopLv", 0);
        model.TownId      = ReInt("TownId");
        model.WorkYear    = ReInt("WorkYear");
        model.PicImgId    = ReStr("PicImgId");

        #region 事务开启
        TransactionOptions transactionOption = new TransactionOptions();
        transactionOption.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
        using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOption))
        {
            #endregion
            bll.SaveResume(model);
            //string EduArrayStr = ReStr("EduArrayStr").Trim();

            //string[] EduArray = EduArrayStr.Split('|');
            //int i = EduArray.Length;



            bll.DeleteEdu(" ResumeId='" + model.ResumeId + "' ");
            DataTable dtEduArray = ReTable("EduArrayStr");

            if (dtEduArray != null)
            {
                foreach (DataRow dr in dtEduArray.Rows)
                {
                    EducationModel eduModel = new EducationModel();
                    eduModel.EducationSchool = dr["EducationSchool"].ToString();
                    eduModel.SubName         = dr["SubName"].ToString();
                    eduModel.BeginDate       = DateTime.Parse(dr["BeginDate"].ToString());
                    eduModel.EndDate         = DateTime.Parse(dr["EndDate"].ToString());
                    eduModel.EducationMemo   = "";
                    eduModel.ResumeId        = model.ResumeId;
                    eduModel.OrderNo         = 1;
                    bll.SaveEduCation(eduModel);
                }
            }



            //开始添加求职意向的职位
            DataTable dtJobType = ReTable("JobTypeArrayStr");

            if (dtJobType != null)
            {
                bll.DeleteResumeVsJobType(" ResumeId='" + model.ResumeId + "' ");

                foreach (DataRow dr in dtJobType.Rows)
                {
                    ResumeVsJobTypeModel vsmodel = new ResumeVsJobTypeModel();
                    vsmodel.JobTypeId = decimal.Parse(dr["JobTypeId"].ToString());
                    vsmodel.ResumeId  = model.ResumeId;

                    bll.SaveResumeVsJobType(vsmodel);
                }
            }
            else
            {
            }



            ReDict2.Add("ResumeId", model.ResumeId);

            #region 事务关闭
            transactionScope.Complete();
        }
        #endregion

        ReTrue();
    }