Esempio n. 1
0
        private string getsubtypesaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag    = "1";
            string subtype = "";
            string type    = "empty";

            if (jp.getValue("SRVTypeNo1") != "")
            {
                type = jp.getValue("SRVTypeNo1");
            }
            try
            {
                int row = 0;
                Business.Base.BusinessServiceType bt = new Business.Base.BusinessServiceType();
                foreach (Entity.Base.EntityServiceType it in bt.GetListQuery(string.Empty, string.Empty, type, string.Empty, true))
                {
                    subtype += it.SRVTypeNo + ":" + it.SRVTypeName + ";";
                    row++;
                }

                collection.Add(new JsonNumericValue("row", row));
                collection.Add(new JsonStringValue("subtype", subtype));
            }
            catch { flag = "2"; }

            collection.Add(new JsonStringValue("type", "getsubtypes"));
            collection.Add(new JsonStringValue("flag", flag));

            return(collection.ToString());
        }
Esempio n. 2
0
        /*
         * 新增获取下拉列表数据
         */
        private string GetServiceType(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            int flag = 0;

            try
            {
                string parentNo = string.IsNullOrEmpty(jp.getValue("parentNo")) ? "null" : jp.getValue("parentNo");
                Business.Base.BusinessServiceType bst = new Business.Base.BusinessServiceType();
                var serviceList = new List <EntityServiceType>();
                foreach (EntityServiceType item in bst.GetListQuery(string.Empty, string.Empty, parentNo, string.Empty, true))
                {
                    serviceList.Add(item);
                }
                collection.Add(new JsonStringValue("data", JsonConvert.SerializeObject(serviceList.Select(a => new { a.SRVTypeNo, a.SRVTypeName }))));
                collection.Add(new JsonStringValue("bindID", jp.getValue("bindID")));
                collection.Add(new JsonStringValue("selectNo", jp.getValue("selectNo")));
            }
            catch (Exception ex)
            {
                flag = 2;
                collection.Add(new JsonStringValue("ex", ex.ToString()));
            }
            collection.Add(new JsonStringValue("type", "getServiceType"));
            collection.Add(new JsonNumericValue("flag", flag));
            return(collection.ToString());
        }
Esempio n. 3
0
        private string updateaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

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

                collection.Add(new JsonStringValue("SRVNo", bc.Entity.SRVNo));
                collection.Add(new JsonStringValue("SRVName", bc.Entity.SRVName));
                collection.Add(new JsonStringValue("SRVTypeNo1", bc.Entity.SRVTypeNo1));
                collection.Add(new JsonStringValue("SRVTypeNo1Name", bc.Entity.SRVTypeNo1Name));
                collection.Add(new JsonStringValue("SRVTypeNo2", bc.Entity.SRVTypeNo2));
                collection.Add(new JsonStringValue("SRVTypeNo2Name", bc.Entity.SRVTypeNo2Name));
                collection.Add(new JsonStringValue("SRVSPNo", bc.Entity.SRVSPNo));
                collection.Add(new JsonStringValue("SRVSPName", bc.Entity.SRVSPName));
                collection.Add(new JsonStringValue("CANo", bc.Entity.CANo));
                collection.Add(new JsonStringValue("CAName", bc.Entity.CAName));
                collection.Add(new JsonStringValue("SRVCalType", bc.Entity.SRVCalType));
                collection.Add(new JsonStringValue("SRVRoundType", bc.Entity.SRVRoundType));
                collection.Add(new JsonStringValue("SRVDecimalPoint", bc.Entity.SRVDecimalPoint.ToString()));
                collection.Add(new JsonStringValue("SRVRate", bc.Entity.SRVRate.ToString("0.####")));
                collection.Add(new JsonStringValue("SRVTaxRate", bc.Entity.SRVTaxRate.ToString("0.####")));
                collection.Add(new JsonStringValue("SRVRemark", bc.Entity.SRVRemark));

                string subtype = "";
                int    row     = 0;
                Business.Base.BusinessServiceType bs = new Business.Base.BusinessServiceType();
                foreach (Entity.Base.EntityServiceType it in bs.GetListQuery(string.Empty, string.Empty, bc.Entity.SRVTypeNo1, string.Empty, true))
                {
                    subtype += it.SRVTypeNo + ":" + it.SRVTypeName + ";";
                    row++;
                }
                collection.Add(new JsonNumericValue("row", row));
                collection.Add(new JsonStringValue("subtype", subtype));

                string subtype1 = "";
                int    row1     = 0;
                Business.Base.BusinessChargeAccount ba = new Business.Base.BusinessChargeAccount();
                foreach (Entity.Base.EntityChargeAccount it in ba.GetListQuery(string.Empty, string.Empty, bc.Entity.SRVSPNo))
                {
                    subtype1 += it.CANo + ":" + it.CAName + " - " + it.CASPName + ";";
                    row1++;
                }
                collection.Add(new JsonNumericValue("row1", row1));
                collection.Add(new JsonStringValue("subtype1", subtype1));
            }
            catch
            { flag = "2"; }

            collection.Add(new JsonStringValue("type", "update"));
            collection.Add(new JsonStringValue("flag", flag));

            return(collection.ToString());
        }