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(); } }
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(); } }
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(); } }
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())); }