public void GetPlanByChanID(int ChanID) { StringBuilder str = new StringBuilder(); str.AppendFormat("a.ChanID='{0}'", ChanID); Dictionary <string, object> dic = new Dictionary <string, object>(); List <Maticsoft.Model.Plans> list = new BLL.Plans().GetModelList(str.ToString()); int count = new BLL.Plans().GetRecordCount(str.ToString()); dic.Add("code", "0"); dic.Add("msg", ""); dic.Add("count", 10); dic.Add("data", list); JavaScriptSerializer json = new JavaScriptSerializer(); string j = json.Serialize(dic); Context.Response.Write(j); }
public void AddPlans(int ChanID, string PlanContent, string PlanResult) { int[] a = new int[4]; a = GetRandomByGuid(a); string bh = "PN" + DateTime.Now.ToString("yyyyMMdd"); for (int j = 0; j < a.Length; j++) { bh += a[j]; } Model.Plans model = new Model.Plans { ChanID = ChanID, PlanContent = PlanContent, PlanDate = DateTime.Now, PlanResult = PlanResult, PlanResultDate = DateTime.Now, PlanID = bh }; bool check = new BLL.Plans().Add(model); }