public ActionResult ScoreCash(string agentId, int amount, string bankAccount, string bankPerson, string bankName) { AjaxResult result = new AjaxResult(); try { ScoreCash sc = new ScoreCash(); sc.c_user_id = agentId.ToString(); sc.c_cash_state = 0; sc.c_amount = amount; sc.c_bank_name = bankName; sc.c_bank_person = bankPerson; sc.c_bank_account = bankAccount; sc.F_CreatorTime = DateTime.Now; ScoreCashLogic.InsertNewEntiy(sc); result.state = ResultType.success.ToString(); result.message = "成功"; return(Content(result.ToJson())); } catch (Exception ex) { result.state = ResultType.error.ToString(); result.message = string.Format("提交失败({0})", ex.Message); return(Content(result.ToJson())); throw; } }
public static void DeleteEntity(int ScoreCashId) { using (DistributionContext context = new DistributionContext()) { ScoreCash DelScoreCash = context.t_score_cash.Find(ScoreCashId); context.t_score_cash.Remove(DelScoreCash); context.SaveChanges(); } }
public static void UpdateEntity(ScoreCash UpdateScoreCash) { using (DistributionContext context = new DistributionContext()) { ScoreCash ag = context.t_score_cash.Find(UpdateScoreCash.F_Id); CommLogic.DeepClone<ScoreCash>(ag, UpdateScoreCash); ag.F_LastModifyTime = DateTime.Now; context.SaveChanges(); } }
public static void InsertNewEntiy(ScoreCash NewScoreCash) { using (DistributionContext context = new DistributionContext()) { NewScoreCash.F_Id = Guid.NewGuid().ToString(); context.t_score_cash.Add(NewScoreCash); context.SaveChanges(); } }