Ejemplo n.º 1
0
        private string deleteaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Base.BusinessOrderType bc = new project.Business.Base.BusinessOrderType();
                bc.load(jp.getValue("id"), user.Entity.AccID);
                if (obj.ExecuteDataSet("select 1 from WO_WorkOrder where OrderType='" + bc.Entity.OrderTypeNo + "' and AccID='" + user.Entity.AccID + "'").Tables[0].Rows.Count > 0)
                {
                    flag = "3";
                }
                else
                {
                    int r = bc.delete();
                    if (r <= 0)
                    {
                        flag = "2";
                    }
                }
            }
            catch { flag = "2"; }

            collection.Add(new JsonStringValue("type", "delete"));
            collection.Add(new JsonStringValue("flag", flag));
            collection.Add(new JsonStringValue("liststr", createList()));

            return(collection.ToString());
        }
Ejemplo n.º 2
0
        private string deleteaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

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

                //if (obj.PopulateDataSet("select 1 from Mstr_Billboard where OrderType='" + bc.Entity.OrderTypeNo + "'").Tables[0].Rows.Count > 0)
                //{
                //    flag = "3";
                //}
                //else
                //{
                int r = bc.delete();
                if (r <= 0)
                {
                    flag = "2";
                }
                //}
            }
            catch { flag = "2"; }

            collection.Add(new JsonStringValue("type", "delete"));
            collection.Add(new JsonStringValue("flag", flag));
            collection.Add(new JsonStringValue("liststr", createList(jp.getValue("OrderTypeNameS"))));

            return(collection.ToString());
        }