예제 #1
0
        private string getcanoaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag    = "1";
            string subtype = "";
            string type    = "empty";

            if (jp.getValue("SRVSPNo") != "")
            {
                type = jp.getValue("SRVSPNo");
            }
            try
            {
                int row = 0;
                Business.Base.BusinessChargeAccount bt = new Business.Base.BusinessChargeAccount();
                foreach (Entity.Base.EntityChargeAccount it in bt.GetListQuery(string.Empty, string.Empty, type))
                {
                    subtype += it.CANo + ":" + it.CAName + " - " + it.CASPName + ";";
                    row++;
                }

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

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

            return(collection.ToString());
        }
예제 #2
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());
        }