示例#1
0
 /// <summary>
 /// 提交申请
 /// </summary>
 /// <param name="expertApplyLogEntity"></param>
 /// <returns></returns>
 public bool SubmitApply(ExpertApplyLogEntity expertApplyLogEntity)
 {
     return ExpertApplyBusProvider.SubmitApply(expertApplyLogEntity);
 }
示例#2
0
 /// <summary>
 /// 更新申请信息
 /// </summary>
 /// <param name="expertApplyLogEntity"></param>
 /// <returns></returns>
 public bool UpdateApply(ExpertApplyLogEntity expertApplyLogEntity)
 {
     return ExpertApplyBusProvider.UpdateApply(expertApplyLogEntity);
 }
        public ExecResult SubmitApply(ExpertApplyLogEntity expertApplyEntity)
        {
            ExecResult execResult = new ExecResult();
            try
            {
                IExpertApplyService expertApplyService = ServiceContainer.Instance.Container.Resolve<IExpertApplyService>();

                ExpertApplyLogQuery queryExpertApply = new ExpertApplyLogQuery();
                queryExpertApply.LoginName = expertApplyEntity.LoginName;
                queryExpertApply.JournalID = expertApplyEntity.JournalID;

                //验证是否提交过申请
                IList<ExpertApplyLogEntity> list = expertApplyService.GetExpertApplyInfoList(queryExpertApply);
                if (list != null && list.Count > 0)
                {
                    execResult.result = EnumJsonResult.failure.ToString();
                    execResult.msg = "此邮箱提交过申请!请更换其他邮箱提交申请或联系编辑部。";
                }
                else//提交申请
                {
                    expertApplyService.SubmitApply(expertApplyEntity);
                    execResult.result = EnumJsonResult.success.ToString();
                    execResult.msg = "申请提交成功,请等待编辑部审核。\r\n审核结果将会以邮件形式发送到您的邮箱。";
                }
            }
            catch (Exception ex)
            {
                execResult.result = EnumJsonResult.error.ToString();
                execResult.msg = "提交申请失败:" + ex.Message;
                LogProvider.Instance.Error("提交申请出现异常:" + ex.Message);
            }
            return execResult;
        }
 /// <summary>
 /// 更新申请信息
 /// </summary>
 /// <param name="expertApplyEntity"></param>
 /// <returns></returns>
 public ExecResult UpdateApply(ExpertApplyLogEntity expertApplyEntity)
 {
     ExecResult result = new ExecResult();
     try
     {
         IExpertApplyService service = ServiceContainer.Instance.Container.Resolve<IExpertApplyService>();
         bool flag = service.UpdateApply(expertApplyEntity);
         if (flag)
         {
             result.result = EnumJsonResult.success.ToString();
             result.msg = "成功";
         }
         else
         {
             result.result = EnumJsonResult.failure.ToString();
             result.msg = "审核失败";
         }
     }
     catch (Exception ex)
     {
         result.result = EnumJsonResult.error.ToString();
         result.msg = "审核专家申请时出现异常:" + ex.Message;
     }
     return result;
 }
 /// <summary>
 /// 持久化一个新对象
 /// </summary>
 /// <param name="expertApplyLogEntity"></param>
 /// <returns></returns>
 public bool SubmitApply(ExpertApplyLogEntity expertApplyLogEntity)
 {
     return ExpertApplyDataAccess.Instance.SubmitApply(expertApplyLogEntity);
 }
 /// <summary>
 /// 更新数据
 /// </summary>
 /// <param name="expertApplyLogEntity"></param>
 /// <returns></returns>
 public bool UpdateApply(ExpertApplyLogEntity expertApplyLogEntity)
 {
     return ExpertApplyDataAccess.Instance.UpdateApply(expertApplyLogEntity);
 }
 /// <summary>
 /// 更新申请信息
 /// </summary>
 /// <param name="expertApplyLogEntity"></param>
 /// <returns></returns>
 public ExecResult UpdateApply(ExpertApplyLogEntity expertApplyLogEntity)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     ExecResult execResult = clientHelper.PostAuth<ExecResult, ExpertApplyLogEntity>(GetAPIUrl(APIConstant.EXPERTAPPLY_UPDATEAPPLY), expertApplyLogEntity);
     return execResult;
 }
        /// <summary>
        /// 更新专家申请数据
        /// </summary>
        /// <param name="AdminID"></param>
        /// <param name="NewPwd"></param>
        /// <returns></returns>
        public bool UpdateApply(ExpertApplyLogEntity expertApplyEntity)
        {
            bool flag = false;
            string sql = "UPDATE dbo.ExpertApplyLog SET Status=@Status,ActionUser=@ActionUser,ActionDate=@ActionDate WHERE JournalID=@JournalID AND LoginName=@LoginName ";
            DbCommand cmd = db.GetSqlStringCommand(sql);

            db.AddInParameter(cmd, "@JournalID", DbType.Int64, expertApplyEntity.JournalID);
            db.AddInParameter(cmd, "@LoginName", DbType.AnsiString, expertApplyEntity.LoginName);
            db.AddInParameter(cmd, "@Status", DbType.Byte, expertApplyEntity.Status);
            db.AddInParameter(cmd, "@ActionUser", DbType.Int64, expertApplyEntity.ActionUser);
            db.AddInParameter(cmd, "@ActionDate", DbType.DateTime, DateTime.Now);

            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch (SqlException sqlEx)
            {
                throw sqlEx;
            }
            return flag;
        }
        public bool SubmitApply(ExpertApplyLogEntity expertApplyEntity)
        {
            bool flag = false;
            DbCommand cmd = null;
            StringBuilder sqlCommandText = new StringBuilder();
            sqlCommandText.Append(" @JournalID");
            sqlCommandText.Append(", @LoginName");
            sqlCommandText.Append(", @RealName");
            sqlCommandText.Append(", @Gender");
            sqlCommandText.Append(", @Birthday");
            sqlCommandText.Append(", @Education");
            sqlCommandText.Append(", @JobTitle");
            sqlCommandText.Append(", @Tel");
            sqlCommandText.Append(", @Mobile");
            sqlCommandText.Append(", @WorkUnit");
            sqlCommandText.Append(", @Address");
            sqlCommandText.Append(", @ReviewDomain");
            sqlCommandText.Append(", @ResearchTopics");
            sqlCommandText.Append(", @BankID");
            sqlCommandText.Append(", @BankType");
            sqlCommandText.Append(", @ZipCode");
            sqlCommandText.Append(", @Remark");
            sqlCommandText.Append(", @Status");
            sqlCommandText.Append(", @AddDate");
            sqlCommandText.Append(", @ActionUser");
            sqlCommandText.Append(", @ActionDate");

            cmd = db.GetSqlStringCommand(String.Format("INSERT INTO dbo.ExpertApplyLog ({0}) VALUES ({1})", sqlCommandText.ToString().Replace("@", ""), sqlCommandText.ToString()));

            db.AddInParameter(cmd, "@JournalID", DbType.Int64, expertApplyEntity.JournalID);
            db.AddInParameter(cmd, "@LoginName", DbType.String, expertApplyEntity.LoginName);
            db.AddInParameter(cmd, "@RealName", DbType.String, expertApplyEntity.RealName);
            db.AddInParameter(cmd, "@Gender", DbType.Int16, expertApplyEntity.Gender);
            db.AddInParameter(cmd, "@Birthday", DbType.DateTime, expertApplyEntity.Birthday);
            db.AddInParameter(cmd, "@Education", DbType.Int16, expertApplyEntity.Education);
            db.AddInParameter(cmd, "@JobTitle", DbType.Int16, expertApplyEntity.JobTitle);
            db.AddInParameter(cmd, "@Tel", DbType.String, expertApplyEntity.Tel);
            db.AddInParameter(cmd, "@Mobile", DbType.String, expertApplyEntity.Mobile);
            db.AddInParameter(cmd, "@WorkUnit", DbType.String, expertApplyEntity.WorkUnit);
            db.AddInParameter(cmd, "@Address", DbType.String, expertApplyEntity.Address);
            db.AddInParameter(cmd, "@ReviewDomain", DbType.String, expertApplyEntity.ReviewDomain);
            db.AddInParameter(cmd, "@ResearchTopics", DbType.String, expertApplyEntity.ResearchTopics);
            db.AddInParameter(cmd, "@BankID", DbType.String, expertApplyEntity.BankID);
            db.AddInParameter(cmd, "@BankType", DbType.String, expertApplyEntity.BankType);

            db.AddInParameter(cmd, "@ZipCode", DbType.String, expertApplyEntity.ZipCode);
            db.AddInParameter(cmd, "@Remark", DbType.String, expertApplyEntity.Remark);
            db.AddInParameter(cmd, "@Status", DbType.Byte, expertApplyEntity.Status);
            db.AddInParameter(cmd, "@AddDate", DbType.DateTime, DateTime.Now);
            db.AddInParameter(cmd, "@ActionUser", DbType.Int64, expertApplyEntity.ActionUser);
            db.AddInParameter(cmd, "@ActionDate", DbType.DateTime, Convert.ToDateTime("1970-01-01"));

            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch (SqlException sqlEx)
            {
                throw sqlEx;
            }
            return flag;
        }
        public List<ExpertApplyLogEntity> MakeExpertApplyInfoList(IDataReader dr)
        {
            List<ExpertApplyLogEntity> list = new List<ExpertApplyLogEntity>();
            while (dr.Read())
            {
                ExpertApplyLogEntity expertApplyEntity = new ExpertApplyLogEntity();
                expertApplyEntity.PKID = (Int64)dr["PKID"];
                expertApplyEntity.JournalID = (Int64)dr["JournalID"];
                expertApplyEntity.LoginName = (String)dr["LoginName"];
                expertApplyEntity.RealName = (String)dr["RealName"];
                expertApplyEntity.Gender = (Byte)dr["Gender"];
                expertApplyEntity.Mobile = (String)dr["Mobile"];
                expertApplyEntity.Tel = (String)dr["Tel"];
                expertApplyEntity.Education = (Int32)dr["Education"];
                expertApplyEntity.JobTitle = (Int32)dr["JobTitle"];
                expertApplyEntity.WorkUnit = (String)dr["WorkUnit"];
                expertApplyEntity.Address = (String)dr["Address"];
                expertApplyEntity.ZipCode = (String)dr["ZipCode"];
                expertApplyEntity.Status = (Byte)dr["Status"];
                expertApplyEntity.ResearchTopics = (String)dr["ResearchTopics"];
                expertApplyEntity.Remark = (String)dr["Remark"];
                expertApplyEntity.ActionUser = (Int64)dr["ActionUser"];
                expertApplyEntity.AddDate = (DateTime)dr["AddDate"];
                expertApplyEntity.ActionDate = (DateTime)dr["ActionDate"];
                list.Add(expertApplyEntity);

            }
            dr.Close();
            return list;
        }
 /// <summary>
 /// 根据数据组装一个对象
 /// </summary>
 /// <param name="dr"></param>
 /// <returns></returns>
 public ExpertApplyLogEntity MakeExpertApplyInfo(DataRow dr)
 {
     ExpertApplyLogEntity expertApplyEntity = null;
     if (dr != null)
     {
         expertApplyEntity = new ExpertApplyLogEntity();
         expertApplyEntity.PKID = (Int64)dr["PKID"];
         expertApplyEntity.JournalID = (Int64)dr["JournalID"];
         expertApplyEntity.LoginName = (String)dr["LoginName"];
         expertApplyEntity.RealName = (String)dr["RealName"];
         expertApplyEntity.Gender = (Byte)dr["Gender"];
         expertApplyEntity.Mobile = (String)dr["Mobile"];
         expertApplyEntity.Tel = (String)dr["Tel"];
         expertApplyEntity.Education = (Int32)dr["Education"];
         expertApplyEntity.JobTitle = (Int32)dr["JobTitle"];
         expertApplyEntity.WorkUnit = (String)dr["WorkUnit"];
         expertApplyEntity.Address = (String)dr["Address"];
         expertApplyEntity.ZipCode = (String)dr["ZipCode"];
         expertApplyEntity.Status = (Byte)dr["Status"];
         expertApplyEntity.ResearchTopics = (String)dr["ResearchTopics"];
         expertApplyEntity.Remark = (String)dr["Remark"];
         expertApplyEntity.ActionUser = (Int64)dr["ActionUser"];
         expertApplyEntity.AddDate = (DateTime)dr["AddDate"];
     }
     return expertApplyEntity;
 }