Пример #1
0
        protected void linkBtnApply_Click(object sender, EventArgs e)
        {
            if (Request.Cookies["CurrentUserGUID"] == null)
            {
                linkBtnApply.Text = "用户尚未登陆";
                return;
            }
            else
            {
                if (!Check_UserType())
                {
                    FineUI.Alert.Show("当前账号不允许申请职位");
                    return;
                }
                zlzw.BLL.ResumeCollectionListBLL resumeCollectionListBLL = new zlzw.BLL.ResumeCollectionListBLL();
                System.Data.DataTable dt = resumeCollectionListBLL.GetList("ResumeGuid='"+ Request.QueryString["id"] +"' and EnterpriseGuid='"+ Request.QueryString["type"] +"' and EnterpriseIsDel=1 and IsEnable=1").Tables[0];
                if(dt.Rows.Count > 0)
                {
                    FineUI.Alert.Show("您已申请过该职位");
                    return;
                }

                zlzw.Model.ResumeCollectionListModel resumeCollectionListModel = new zlzw.Model.ResumeCollectionListModel();
                resumeCollectionListModel.EnterpriseGuid = new Guid(Request.QueryString["type"]);//企业GUID
                resumeCollectionListModel.ResumeGuid = new Guid(Request.QueryString["id"]);//职位ID
                resumeCollectionListModel.ResumeCollectionType = 1;//主投简历
                resumeCollectionListModel.EnterpriseIsDel = 1;//企业删除标记
                resumeCollectionListModel.IsEnable = 1;//管理员删除标记
                resumeCollectionListModel.PublishDate = DateTime.Now;//投递日期
                resumeCollectionListModel.Other01 = Request.Cookies["CurrentUserGUID"].Value;//投递人GUID
                resumeCollectionListBLL.Add(resumeCollectionListModel);
                FineUI.Alert.Show("职位申请成功");
            }
        }
		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public zlzw.Model.ResumeCollectionListModel DataRowToModel(DataRow row)
		{
			zlzw.Model.ResumeCollectionListModel model=new zlzw.Model.ResumeCollectionListModel();
			if (row != null)
			{
				if(row["ResumeCollectionID"]!=null && row["ResumeCollectionID"].ToString()!="")
				{
					model.ResumeCollectionID=int.Parse(row["ResumeCollectionID"].ToString());
				}
				if(row["ResumeCollectionGUID"]!=null && row["ResumeCollectionGUID"].ToString()!="")
				{
					model.ResumeCollectionGUID= new Guid(row["ResumeCollectionGUID"].ToString());
				}
				if(row["ResumeCollectionType"]!=null && row["ResumeCollectionType"].ToString()!="")
				{
					model.ResumeCollectionType=int.Parse(row["ResumeCollectionType"].ToString());
				}
				if(row["ResumeGuid"]!=null && row["ResumeGuid"].ToString()!="")
				{
					model.ResumeGuid= new Guid(row["ResumeGuid"].ToString());
				}
				if(row["EnterpriseGuid"]!=null && row["EnterpriseGuid"].ToString()!="")
				{
					model.EnterpriseGuid= new Guid(row["EnterpriseGuid"].ToString());
				}
				if(row["EnterpriseIsDel"]!=null && row["EnterpriseIsDel"].ToString()!="")
				{
					model.EnterpriseIsDel=int.Parse(row["EnterpriseIsDel"].ToString());
				}
				if(row["IsEnable"]!=null && row["IsEnable"].ToString()!="")
				{
					model.IsEnable=int.Parse(row["IsEnable"].ToString());
				}
				if(row["PublishDate"]!=null && row["PublishDate"].ToString()!="")
				{
					model.PublishDate=DateTime.Parse(row["PublishDate"].ToString());
				}
				if(row["Other01"]!=null)
				{
					model.Other01=row["Other01"].ToString();
				}
				if(row["Other02"]!=null)
				{
					model.Other02=row["Other02"].ToString();
				}
				if(row["Other03"]!=null)
				{
					model.Other03=row["Other03"].ToString();
				}
				if(row["Other04"]!=null)
				{
					model.Other04=row["Other04"].ToString();
				}
				if(row["Other05"]!=null && row["Other05"].ToString()!="")
				{
					model.Other05=int.Parse(row["Other05"].ToString());
				}
			}
			return model;
		}
        protected void imgBtnDownload_Click(object sender, ImageClickEventArgs e)
        {
            string strEnterpriseGUID = Get_EnterpriaseGUID(Request.Cookies["CurrentUserGUID"].Value);
            zlzw.Model.ResumeCollectionListModel resumeCollectionListModel = new zlzw.Model.ResumeCollectionListModel();
            resumeCollectionListModel.ResumeCollectionType = 0;//类型为企业简历收藏
            resumeCollectionListModel.ResumeGuid = new Guid(Request.QueryString["id"]);//当前简历GUID
            resumeCollectionListModel.EnterpriseGuid = new Guid(strEnterpriseGUID);//收藏企业的GUID
            resumeCollectionListModel.EnterpriseIsDel = 1;//企业标注为可显示
            resumeCollectionListModel.IsEnable = 1;
            resumeCollectionListModel.PublishDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));

            #region 减去可下载简历数

            zlzw.BLL.GeneralEnterpriseBLL generalEnterpriseBLL = new zlzw.BLL.GeneralEnterpriseBLL();
            System.Data.DataTable dt = generalEnterpriseBLL.GetList("EnterpriseGuid='" + strEnterpriseGUID + "'").Tables[0];
            zlzw.Model.GeneralEnterpriseModel generalEnterpriseModel = generalEnterpriseBLL.GetModel(int.Parse(dt.Rows[0]["EnterpriseID"].ToString()));
            if (generalEnterpriseModel.DownloadResume < 1)
            {
                FineUI.Alert.Show("您剩余的简历下载数不足,请联系我们的客服人员");
                return;
            }
            generalEnterpriseModel.DownloadResume = generalEnterpriseModel.DownloadResume - 1;
            generalEnterpriseModel.CreateDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
            zlzw.BLL.ResumeCollectionListBLL resumeCollectionListBLL = new zlzw.BLL.ResumeCollectionListBLL();
            resumeCollectionListBLL.Add(resumeCollectionListModel);
            generalEnterpriseBLL.Update(generalEnterpriseModel);

            FineUI.Alert.Show("简历下载成功");

            #endregion

        }
		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public zlzw.Model.ResumeCollectionListModel GetModel(int ResumeCollectionID)
		{
			SqlParameter[] parameters = {
					new SqlParameter("@ResumeCollectionID", SqlDbType.Int,4)
			};
			parameters[0].Value = ResumeCollectionID;

			zlzw.Model.ResumeCollectionListModel model=new zlzw.Model.ResumeCollectionListModel();
			DataSet ds= DbHelperSQL.RunProcedure("ResumeCollectionList_GetModel",parameters,"ds");
			if(ds.Tables[0].Rows.Count>0)
			{
				return DataRowToModel(ds.Tables[0].Rows[0]);
			}
			else
			{
				return null;
			}
		}