Esempio n. 1
0
        public ActionResult GetBoListByID()
        {
            BOManager manager = new BOManager();
            string    BOID    = Request["BOID"];

            return(JsonNT(manager.GetBoListByID(BOID)));
        }
Esempio n. 2
0
        public string GetBoListByBOTID()
        {
            string data = "";

            BOList = new List <BOModel>();
            BOManager manager = new BOManager();
            string    BOTID   = Request["BOTID"];
            string    BONAME  = Request["BONAME"].Trim();

            BOList = manager.GetBoListByBOTID(BOTID);
            foreach (BOModel rtm in BOList)
            {
                if (rtm.Name.Contains(BONAME))
                {
                    if (data == "")
                    {
                        data = "{id:'" + rtm.Boid + "',text:'" + rtm.Name + "',BOC:'" + rtm.Boc + "'}";
                    }
                    else
                    {
                        data = data + "," + "{id:'" + rtm.Boid + "',text:'" + rtm.Name + "',BOC:'" + rtm.Boc + "'}";
                    }
                }
            }
            if (data != "")
            {
                data = "[" + data + "]";
            }

            return(data);
        }
Esempio n. 3
0
        public bool SaveBOPara()
        {
            String json   = Request["data"];
            string BOID   = Request["BOID"];
            string Source = "";
            string NS     = Request["NS"].Trim();

            BOManager     manager = new BOManager();
            List <string> SqlList = new List <string>();
            ArrayList     rows    = (ArrayList)Decode(json);
            StringBuilder MD      = new StringBuilder();

            MD.Append(" <PropertySet" + " name=" + '"' + NS + '"' + "> ");
            foreach (Hashtable row in rows)
            {
                String id = row["id"] != null ? row["id"].ToString() : "";
                //根据记录状态,进行不同的增加、删除、修改操作
                String state = row["_state"] != null ? row["_state"].ToString() : "";
                string n     = row["name"].ToString();
                string v     = row["value"].ToString();
                string t     = row["editor"].ToString();
                if (t == "textbox")
                {
                    t = "String";
                }
                else if (t == "spinner")
                {
                    t = "Decimal";
                }
                else if (t == "selectvalue")
                {
                    t = "selectvalue";
                }
                else
                {
                    t = "date";
                }
                MD.Append(" <P ");
                MD.Append(" n=" + '"' + n + '"' + " t=" + '"' + t + '"' + ">" + v + "");
                MD.Append(" </P>  ");
            }
            MD.Append(" </PropertySet > ");
            PropertyManager PropManager = new PropertyManager();
            PropertyModel   PropModel   = new PropertyModel();

            PropModel.MD       = MD.ToString();
            PropModel.BOId     = BOID;
            PropModel.NS       = NS;
            PropModel.MdSource = Source;

            if (PropManager.Update(PropModel) == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 4
0
        public void DelBOByID()
        {
            BOManager manager = new BOManager();
            BOModel   bo      = new BOModel();
            string    BOID    = Request["BOID"];

            bo.Boid = BOID;
            int i = manager.Delete(bo);
        }
Esempio n. 5
0
        public ActionResult GetALIASNAME()
        {
            BOManager manager = new BOManager();
            string    BOID    = Request["BOID"];

            DataTable Dt = manager.GetALIASNAME(BOID);

            return(JsonNT(Dt));
        }
Esempio n. 6
0
        public string UpdatBOBYID()
        {
            BOManager manager = new BOManager();
            BOModel   model   = new BOModel();

            model.Boid  = Request["BOID"];;
            model.Name  = Request["BONAME"];;
            model.Botid = Request["BOTID"];
            if (Request["ISUSE"] == "是")
            {
                model.Isuse = "1";
            }
            else
            {
                model.Isuse = "0";
            }
            string         Result = "OK";
            List <BOModel> BoList = manager.GetBoListByName(Request["BONAME"], Request["BOTID"]);

            if (BoList.Count() > 0)//对象名称已经存在!
            {
                Result = "NO";
            }
            else
            {
                if (manager.Update(model) == 1)
                {
                    Result = "OK";
                }
                else
                {
                    Result = "failse";
                }
            }
            return(Result);
        }
Esempio n. 7
0
        public string SaveObjInfo()
        {
            String jsons      = Request["data"];
            string BOname     = Request["BOname"].Trim();
            string nameBM     = Request["nameBM"].Trim();
            string AppDomains = Request["AppDomain"];

            string         BOTID   = Request["BOTID"];
            string         BOID    = System.Guid.NewGuid().ToString();
            BOManager      manager = new BOManager();
            List <string>  SqlList = new List <string>();
            string         Result  = "OK";
            List <BOModel> BoList  = manager.GetBoListByName(BOname, BOTID);

            if (BoList.Count() > 0)//对象名称已经存在!
            {
                Result = "NO";
            }
            else
            {
                string Sql = "insert into bo( BOID ,  NAME ,  BOTID,  ISUSE ) " +
                             " values('" + BOID + "','" + BOname + "','" + BOTID + "','1')";
                SqlList.Add(Sql);
                string[] sjson = jsons.Split('|');
                foreach (string json in sjson)
                {
                    ArrayList rows = (ArrayList)Decode(json);
                    foreach (Hashtable row in rows)
                    {
                        foreach (DictionaryEntry de in row) //ht为一个Hashtable实例
                        {
                            StringBuilder Property = new StringBuilder();
                            Property.Append(" <PropertySet" + " name=" + '"' + de.Key + '"' + "> ");
                            foreach (Hashtable tde in (ArrayList)de.Value)
                            {
                                string n = tde["name"].ToString();
                                string v = tde["value"].ToString();
                                string t = tde["editor"].ToString();
                                if (t == "textbox")
                                {
                                    t = "String";
                                }
                                else if (t == "spinner")
                                {
                                    t = "Decimal";
                                }
                                else if (t == "selectvalue")
                                {
                                    t = "String";
                                }
                                else
                                {
                                    t = "date";
                                }
                                Property.Append(" <P ");
                                Property.Append(" n=" + '"' + n + '"' + " t=" + '"' + t + '"' + ">" + v + "");
                                Property.Append(" </P>  ");
                            }
                            Property.Append(" </PropertySet > ");
                            Sql = "insert into property(boid, ns,md) values('" + BOID + "','" + de.Key + "','" + Property.ToString() + "') ";
                            SqlList.Add(Sql);
                        }
                    }
                }
                Sql = "insert into aliasname( BOID,  NAME ,  APPDOMAIN) " +
                      " values('" + BOID + "','" + nameBM + "','" + AppDomains + "')";
                SqlList.Add(Sql);
                bool b = manager.InsertBOandPara(SqlList);
                if (b)
                {
                    Result = "OK";
                }
                else
                {
                    Result = "Fails";
                }
            }
            return(Result);
        }