Beispiel #1
0
        /// <summary>
        /// 获取个人经验信息详情
        /// </summary>
        private void GetJob()
        {
            int jobid;

            if (!int.TryParse(nv["jobid"], out jobid))
            {
                HttpContext.Current.Response.Write("参数错误");
                return;
            }

            E_JobExperience data = new E_JobExperience();

            data.PersonalID      = pp.PersonalID;
            data.UserID          = pp.UserID;
            data.JobExperienceID = jobid;

            data = new T_JobExperience().GetModel(data);
            if (data != null)
            {
                JsonObjectCollection colDR = new JsonObjectCollection();
                colDR.Add(new JsonStringValue("startdate", string.Format("{0:yyyy-MM-dd}", data.StartDate)));
                colDR.Add(new JsonStringValue("enddate", string.Format("{0:yyyy-MM-dd}", data.EndDate)));
                colDR.Add(new JsonStringValue("companyname", data.CompanyName));
                colDR.Add(new JsonStringValue("scale", data.Scale.ToString()));
                colDR.Add(new JsonStringValue("departments", data.Departments));
                colDR.Add(new JsonStringValue("position", data.Position));
                colDR.Add(new JsonStringValue("description", data.JobDescription));
                HttpContext.Current.Response.Write(colDR.ToString());
            }
        }
Beispiel #2
0
        /// <summary>
        /// 修改工作信息
        /// </summary>
        private void UpdateJob()
        {
            //获取数据
            DateTime startdate;
            int      jobid = 0, scale;
            string   type = nv["type"];

            if (type == "update")
            {
                if (!int.TryParse(nv["jobid"], out jobid))
                {
                    HttpContext.Current.Response.Write("参数错误");
                    return;
                }
            }
            if (!DateTime.TryParse(nv["startdate"], out startdate) || !int.TryParse(nv["scale"], out scale) || string.IsNullOrEmpty(nv["companyname"]))
            {
                HttpContext.Current.Response.Write("参数错误");
                return;
            }
            string companyname = nv["companyname"];
            string departments = nv["departments"];
            string position    = nv["position"];
            string description = nv["description"];

            E_JobExperience data = new E_JobExperience();

            data.JobExperienceID = jobid;
            data.UserID          = pp.UserID;
            data.PersonalID      = pp.PersonalID;
            data.StartDate       = startdate;
            if (nv["enddate"] == "")
            {
                data.EndDate = null;
            }
            else
            {
                data.EndDate = Convert.ToDateTime(nv["enddate"]);
            }
            data.CompanyName    = companyname;
            data.SetScale       = scale;
            data.Departments    = departments;
            data.Position       = position;
            data.JobDescription = description;
            bool flag;

            if (type == "add")
            {
                flag = new T_JobExperience().Add(data);
            }
            else
            {
                flag = new T_JobExperience().Update(data);
            }
            HttpContext.Current.Response.Write(flag ? data.JobExperienceID.ToString() : "0");
        }
Beispiel #3
0
        /// <summary>
        /// 删除工作信息
        /// </summary>
        private void DeleteJob()
        {
            int jobid;

            if (!int.TryParse(nv["jobid"], out jobid))
            {
                HttpContext.Current.Response.Write("参数错误");
                return;
            }

            E_JobExperience data = new E_JobExperience();

            data.PersonalID      = pp.PersonalID;
            data.UserID          = pp.UserID;
            data.JobExperienceID = jobid;

            bool flag = new T_JobExperience().Delete(data);

            HttpContext.Current.Response.Write(flag ? "1" : "0");
        }