예제 #1
0
        public override object GetData()
        {
            string page = "";

            try { page = (string)optdatas["page"]; }
            catch { page = ""; }
            string uid = "";

            try { uid = (string)optdatas["uid"]; }
            catch { uid = ""; }
            string code = "";

            try { code = (string)optdatas["code"]; }
            catch { code = ""; }
            string titile = "";

            try { titile = (string)optdatas["title"]; }
            catch { titile = ""; }
            JsonData  js = new JsonData();
            DataTable dt = new DataTable();

            try
            {
                string where = "";
                if (titile != "")
                {
                    where += " and a.title like '%" + titile + "%'";
                }
                switch (code)
                {
                case "1": { where += " and a.shoucang=1 "; } break; //收藏的

                case "2": { where += " and a.status=1 "; } break;   //提醒的

                case "3": { where += " and a.dm=1 "; } break;       //已删除的

                case "4": { where += " and a.dm= 0"; } break;       //未删除的

                case "5": { where += " and a.status= 2"; } break;   //完成的
                }
                where += " and a.userid='" + uid + "' ";
                dt     = tdal.get_mydanci(where, page);
                js     = DataTableToJson(dt);
            }
            catch (Exception ex)
            {
                JngsDal.RecordError("complain_dispose", ex.Message);
            }

            return(js);
        }
예제 #2
0
        public override object GetData()
        {
            int    i  = -1;
            string id = "";

            try { id = (string)optdatas["id"]; }
            catch { id = ""; }

            JsonData js = new JsonData();

            try
            {
                var dt = tdal.get_mydanci(" and a.id=" + id + "", "1");
                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0]["shoucang"].ToString() == "0")
                    {
                        Dictionary <string, string> dic = new Dictionary <string, string>();
                        dic.Add("shoucang", "1");
                        BaseDal.UpdateTables("danci_t", dic, "id=" + id + "");
                        i = 1;
                    }
                    else
                    {
                        Dictionary <string, string> dic = new Dictionary <string, string>();
                        dic.Add("shoucang", "0");
                        BaseDal.UpdateTables("danci_t", dic, "id=" + id + "");
                        i = 0;
                    }
                }
            }
            catch (Exception ex)
            {
                JngsDal.RecordError("isshoucang", ex.Message);
            }
            AddJsonProperty("id", ref js);
            js["id"] = i;
            return(js);
        }