protected override void InitApi() { base.InitApi(); //var id = GetReqParms("ad"); //if (string.IsNullOrEmpty(id)) throw new XExcep("0x0006"); mg = DB.x_mch.FirstOrDefault(o => o.mch_id == 1);// CacheHelper.Get<x_mgr>("mch." + id); if (mg == null) { throw new XExcep("0x0006"); } //CacheHelper.Save("mgr." + id, mg, 60 * 60); ValidPower(); }
protected override void InitDict() { base.InitDict(); //var id = GetReqParms("ad");// Context.Request.Cookies["ad"]; //if (string.IsNullOrEmpty("ad")) throw new XExcep("0x0006"); mg = DB.x_mch.FirstOrDefault(o => o.mch_id == 1); //CacheHelper.Get<x_mgr>("mch." + id); if (mg == null) { throw new XExcep("0x0006"); } ValidPower(); //CacheHelper.Save("mgr." + id, mg, 60 * 60); dict.Add("mh", mg); }
protected override Web.Com.XResp Execute() { x_mch ad = new x_mch(); if (id > 0) { ad = DB.x_mch.SingleOrDefault(o => o.mch_id == id); if (ad == null) { throw new XExcep("0x0005"); } } ad.mch_id = id; if (!string.IsNullOrEmpty(pwd)) { ad.pwd = Secret.MD5(pwd); } ad.name = name; ad.account = uid; ad.tel = tel; ad.logo = logo; ad.cp_name = cp_name; ad.cp_addr = cp_addr; ad.cp_man = cp_man; ad.cp_tel = cp_tel; ad.bank_ac_name = bk_ac_name; ad.bank_account = bk_account; ad.bank_name = bk_name; ad.rate = rate; ad.remark = remark; if (ad.mch_id == 0) { ad.ctime = DateTime.Now; DB.x_mch.InsertOnSubmit(ad); } ad.mtime = DateTime.Now; SubmitDBChanges(); return(new XResp()); }