예제 #1
0
        private string deleteaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Base.BusinessRoom bc = new project.Business.Base.BusinessRoom();
                bc.load(jp.getValue("id"));

                if (bc.Entity.RMStatus == "use")
                {
                    flag = "4";
                }
                else
                {
                    int r = bc.delete();
                    if (r <= 0)
                    {
                        flag = "2";
                    }
                    else
                    {
                        #region  步到资源系统

                        string syncResult = string.Empty;
                        try
                        {
                            ResourceService.ResourceService srv = new ResourceService.ResourceService();
                            srv.Url    = ConfigurationManager.AppSettings["ResourceServiceUrl"].ToString();
                            syncResult = srv.DeleteResource(bc.Entity.RMID);
                        }
                        catch (Exception ex)
                        {
                            syncResult = ex.ToString();
                        }
                        collection.Add(new JsonStringValue("sync", syncResult));

                        #endregion
                    }
                }
            }
            catch { flag = "2"; }

            collection.Add(new JsonStringValue("type", "delete"));
            collection.Add(new JsonStringValue("flag", flag));
            collection.Add(new JsonStringValue("liststr", createList(jp.getValue("RMIDS"), jp.getValue("RMLOCNo1S"), jp.getValue("RMLOCNo2S"), jp.getValue("RMLOCNo3S"),
                                                                     jp.getValue("RMLOCNo4S"), jp.getValue("CustNoS"), jp.getValue("RMStatusS"), ParseIntForString(jp.getValue("page")))));

            return(collection.ToString());
        }
예제 #2
0
        private string deleteaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Base.BusinessRoom bc = new project.Business.Base.BusinessRoom();
                bc.load(jp.getValue("id"));

                if (bc.Entity.RMStatus == "use")
                {
                    flag = "4";
                }
                else
                {
                    int r = bc.delete();
                    if (r <= 0)
                    {
                        flag = "2";
                    }
                    else
                    {
                        collection.Add(new JsonStringValue("ZYSync", bc.SyncResource("del")));
                    }
                }
            }
            catch { flag = "2"; }

            collection.Add(new JsonStringValue("type", "delete"));
            collection.Add(new JsonStringValue("flag", flag));
            collection.Add(new JsonStringValue("liststr", createList(jp.getValue("RMIDS"), jp.getValue("RMLOCNo1S"), jp.getValue("RMLOCNo2S"), jp.getValue("RMLOCNo3S"),
                                                                     jp.getValue("RMLOCNo4S"), jp.getValue("CustNoS"), jp.getValue("RMStatusS"), ParseIntForString(jp.getValue("page")))));

            return(collection.ToString());
        }