예제 #1
0
 public static void UpdateEntity(ExpApply UpdateExpApply)
 {
     using (DistributionContext context = new DistributionContext())
     {
         ExpApply ag = context.t_exp_apply.Find(UpdateExpApply.F_Id);
         CommLogic.DeepClone <ExpApply>(ag, UpdateExpApply);
         context.SaveChanges();
     }
 }
예제 #2
0
 public static void DeleteEntity(string ExpApplyId)
 {
     using (DistributionContext context = new DistributionContext())
     {
         ExpApply DelExpApply = context.t_exp_apply.Find(ExpApplyId);
         context.t_exp_apply.Remove(DelExpApply);
         context.SaveChanges();
     }
 }
예제 #3
0
 public static void InsertNewEntiy(ExpApply NewExpApply)
 {
     using (DistributionContext context = new DistributionContext())
     {
         NewExpApply.F_Id          = Guid.NewGuid().ToString();
         NewExpApply.F_CreatorTime = DateTime.Now;
         context.t_exp_apply.Add(NewExpApply);
         context.SaveChanges();
     }
 }
예제 #4
0
        public ActionResult ApplyExpLevelUp(string keyValue)
        {
            AjaxResult result    = new AjaxResult();
            bool       hasRecord = ExpApplyLogic.HasApplyingRecord(keyValue);

            if (!hasRecord)
            {
                ExpApply entity = new ExpApply();
                entity.c_agent_id    = keyValue;
                entity.c_apply_state = 0;
                ExpApplyLogic.InsertNewEntiy(entity);
                result.state   = ResultType.success.ToString();
                result.message = "成功";
            }
            else
            {
                result.state   = ResultType.error.ToString();
                result.message = "您已申请成为加盟店,无需重复申请";
            }
            return(Content(result.ToJson()));
        }