Exemple #1
0
        public Get_OutDeleteGroup Delete(string data)
        {
            Get_OutDeleteGroup json = new Get_OutDeleteGroup();

            try
            {
                Get_InDeleteGroup input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InDeleteGroup>(data);
                DBGroup           db    = new DBGroup();
                int d = db.Delete(input.DayPlanID, input.GroupID);
                if (d == 1)
                {
                    json.result    = "0";
                    json.resultStr = "成功删除一条数据";
                }
                else
                {
                    json.result    = "0";
                    json.resultStr = "返回失败!成功删除" + d + "条数据!";
                }
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }
Exemple #2
0
        public Get_OutUpdate Update(string data)
        {
            Get_OutUpdate json = new Get_OutUpdate();

            try
            {
                Get_InUpdate input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InUpdate>(data);
                DBGroup      db    = new DBGroup();
                int          d     = db.Update(input.group);
                if (d == 1)
                {
                    json.result    = "0";
                    json.resultStr = "成功更新一条数据";
                }
                else
                {
                    json.result    = "0";
                    json.resultStr = "返回失败!成功更新" + d + "条数据!";
                }
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }
Exemple #3
0
        public Get_OutQueryGroups QueryGroups(string data)
        {
            Get_OutQueryGroups json = new Get_OutQueryGroups();

            try
            {
                Get_InQueryGroups input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InQueryGroups>(data);
                DBGroup           db    = new DBGroup();
                resultQueryGroups r     = new resultQueryGroups();
                r.Groups       = db.QueryGroups(input.ID);
                json.data      = r;
                json.result    = "0";
                json.resultStr = "返回成功";
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }
Exemple #4
0
        public Get_OutLoad Load(string data)
        {
            Get_OutLoad json = new Get_OutLoad();

            try
            {
                Get_InLoad input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InLoad>(data);
                DBDayPlan  db    = new DBDayPlan();
                DBGroup    dg    = new DBGroup();
                int        d     = 0;
                List <DayPlanItemGroup> GroupList = dg.QueryGroups(input.DayPlanID);
                foreach (DayPlanItemGroup g in GroupList)
                {
                    DataTable dt = db.QueryItemList(g.ID, input.DayPlanTypeID);
                    d += db.LoadDayPlanInfo(input.BeginTime, DateTime.Now, input.DayPlanTypeID, input.DayPlanID, g.ID, dt);
                }
                int l = db.AddDayPlan_Send(input.BeginTime, input.EndTime, input.DayPlanID, input.DayPlanTypeID);



                if (d >= 1 && l == 1)
                {
                    json.result    = "0";
                    json.resultStr = "成功加载" + d + "条数据!向“Tab_DayPlan_Send”中插入" + l + "条数据";
                }
                else
                {
                    json.result    = "0";
                    json.resultStr = "返回失败!成功加载0条数据!向“Tab_DayPlan_Send”中插入" + l + "条数据";
                }
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }
Exemple #5
0
        public Get_OutGetGroup GetGroup(string data)
        {
            Get_OutGetGroup json = new Get_OutGetGroup();

            try
            {
                Get_InGetGroup input   = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InGetGroup>(data);
                DBGroup        db      = new DBGroup();
                resultGetGroup r       = new resultGetGroup();
                bool           bIsNull = true;
                r.Group        = db.GetGroup(input.DayPlanID, input.GroupID, ref bIsNull);
                r.bExist       = bIsNull;
                json.data      = r;
                json.result    = "0";
                json.resultStr = "返回成功";
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }