Пример #1
0
        public ActionResult SyncBUAUserToInside(string ids)
        {
            IProxy proxy = ProxyFactory.CreateProxy();
            SMC_BUAUserSyncToInsideBO buaSyncBO = Bo.BoFactory.GetSMC_BUAUserSyncToInsideBO;//proxy.CreateObject<SMC_BUAUserSyncToInsideBO>();
            Hashtable result = new Hashtable();

            result["IsSuccess"] = true;
            result["Msg"]       = "操作已提交!";

            try
            {
                buaSyncBO.BUAUserSyncToInside(ids, result);
            }
            catch (Exception ex)
            {
                Log4NetHelper.Error(ex);
                result["Msg"] += ex.Message;
            }

            try
            {
                buaSyncBO.BUAUserSyncToOutside(ids);
            }
            catch (Exception ex)
            {
                Log4NetHelper.Error(ex);
            }
            return(Json(result));
        }
Пример #2
0
        private void syncUsers(string users)
        {
            if (!String.IsNullOrEmpty(users))
            {
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(users);
                XmlNodeList   nodes   = doc.DocumentElement.SelectNodes("//root/node");
                StringBuilder builder = new StringBuilder();
                if (nodes != null)
                {
                    foreach (XmlNode node in nodes)
                    {
                        string uid = node.Attributes["id"].Value;
                        builder.Append(uid);
                        builder.Append(",");
                    }
                }
                SMC_BUAUserSyncToInsideBO buaSyncBO = Bo.BoFactory.GetSMC_BUAUserSyncToInsideBO;

                string ids = builder.ToString();
                try
                {
                    Hashtable result = new Hashtable();
                    buaSyncBO.BUAUserSyncToInside(ids, result);
                }
                catch (Exception ex)
                {
                    Log4NetHelper.Error(ex);
                }

                try
                {
                    buaSyncBO.BUAUserSyncToOutside(ids);
                }
                catch (Exception ex)
                {
                    Log4NetHelper.Error(ex);
                }
            }
        }