コード例 #1
0
        private bool FindParentNode(string appGuid, out TreeNode pNode)
        {
            LogApp app = AppService.Instance.GetApp(appGuid);

            TreeNode tnParent = FindAppGroupNode(app.Group.Name);

            if (tnParent == null)
            {
                MessageBox.Show("无法找到分组\"" + app.Group.Name + "\"的节点");
                pNode = null;
                return(false);
            }

            pNode = null;

            foreach (TreeNode parentNode in tnParent.Nodes)
            {
                if (string.Equals(Convert.ToString(parentNode.Tag), appGuid, StringComparison.OrdinalIgnoreCase))
                {
                    pNode = parentNode;
                    return(true);
                }
            }

            return(false);
        }
コード例 #2
0
ファイル: FormLogin.cs プロジェクト: zainu-99/MYAPPCS
        void DoLogin()
        {
            var data = SqlService.GetDataTable("select * from Users where userid ='" + Utilities.ReplaceQuot(TextBoxUserId.Text) + "' and status =1 and  password='******'");

            if (data.Rows.Count > 0)
            {
                MYAPPCS.Properties.Settings.Default.id_user = data.Rows[0][0].ToString();
                MYAPPCS.Properties.Settings.Default.userid  = data.Rows[0][1].ToString();
                MYAPPCS.Properties.Settings.Default.nama    = data.Rows[0][2].ToString();
                LogApp.Login();
                this.Hide();
                var formMain = new FormMain();
                formMain.Show();
                formMain.formLogin = this;
            }
            else
            {
                MessageBox.Show("Password Atau UserId Salah Atau Account Not Active");
            }
            if (CheckBoxRemember.Checked)
            {
                MYAPPCS.Properties.Settings.Default.userid_remember    = TextBoxUserId.Text;
                MYAPPCS.Properties.Settings.Default.passsword_remember = TextBoxPassword.Text;
            }
            MYAPPCS.Properties.Settings.Default.Save();
        }
コード例 #3
0
ファイル: AppController.cs プロジェクト: khakon/MobileOrders
        public IActionResult LoadApp(IFormFile fileApp, string password)
        {
            try
            {
                if (fileApp.Length > 0)
                {
                    using (var reader = new StreamReader(fileApp.OpenReadStream()))
                    {
                        var parsedContentDisposition = ContentDispositionHeaderValue.Parse(fileApp.ContentDisposition);
                        var fileName = parsedContentDisposition.FileName;
                        if (Regex.Match(fileName, @"\.\w{3,4}$", RegexOptions.IgnoreCase).Value != ".apk")
                        {
                            return(StatusCode(404));
                        }
                        string path = Path.Combine(@"D:\order\app", fileName);

                        using (var stream = new FileStream(path, FileMode.Create))
                        {
                            fileApp.CopyTo(stream);
                        }
                        LogApp fileLog = new LogApp {
                            id = 0, file = fileApp.FileName, path = path, period = DateTime.Now
                        };
                        db.Entry(fileLog).State = EntityState.Added;
                        db.SaveChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                return(StatusCode(404));
            }
            return(Ok("Ok"));
        }
コード例 #4
0
 public LoginController(UserApp userapp, LogApp logApp, UserLogOnApp logonApp, RoleApp roleApp)
 {
     this.userApp  = userapp;
     this.logApp   = logApp;
     this.logonApp = logonApp;
     this.roleApp  = roleApp;
 }
コード例 #5
0
 //[ValidateAntiForgeryToken]
 public ActionResult Login(string Account, string Password, string VerifyCode)
 {
     try
     {
         if (VerifyCodeHelper.Check(VerifyCode))
         {
             T_User t_User = userBLL.CheckLogin(Account, Password);
             if (t_User != null)
             {
                 userBLL.AddProvider(t_User);
                 LogApp.Write(LogApp.Result.Success);
                 return(Content(new JsonMessage {
                     state = "success", msg = "登录成功,正在跳转中...", data = new { url = "/Index/Index" }
                 }.ToJson()));
             }
             else
             {
                 throw new Exception("登录失败");
             }
         }
         else
         {
             throw new Exception("验证码错误");
         }
     }
     catch (Exception ex)
     {
         return(Content(new JsonMessage {
             state = "error", msg = ex.Message
         }.ToJson()));
     }
 }
コード例 #6
0
 private void ButtonDelete_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Delete Data", "Are You Sure?", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         var query = "delete from groups where id = '" + id_group + "'";
         SqlService.ExecuteQuery(query);
         LogApp.Delete("users", DgvRowToString.Generate(dgv, dgv.CurrentRow.Index), "");
         Reload();
     }
 }
コード例 #7
0
ファイル: DBService.cs プロジェクト: guochao2299/LogManage
            public static LogApp FromLogAppPlus(LogAppPlus plus)
            {
                LogApp app = new LogApp(plus.AppGUID);

                app.Name = plus.Name;
                app.IsImportLogsFromFiles = plus.IsImportLogsFromFile;
                app.Group = new LogAppGroup(plus.AppGroupName);

                return(app);
            }
コード例 #8
0
ファイル: DBService.cs プロジェクト: guochao2299/LogManage
            public static LogAppPlus ToLogAppPlus(LogApp app)
            {
                LogAppPlus p = new LogAppPlus();

                p.AppGUID = app.AppGUID;
                p.Name    = app.Name;
                p.IsImportLogsFromFile = app.IsImportLogsFromFiles;
                p.AppGroupName         = app.Group.Name;

                return(p);
            }
コード例 #9
0
ファイル: AppService.cs プロジェクト: guochao2299/LogManage
        public bool UpdateAppProperties(string appGuid, LogApp app)
        {
            if (DBService.Instance.UpdateApplicationProperties(appGuid, app))
            {
                m_existingApps[appGuid].Name = app.Name;
                m_existingApps[appGuid].IsImportLogsFromFiles = app.IsImportLogsFromFiles;
                return(true);
            }

            return(false);
        }
コード例 #10
0
        private void WriteLog(ExceptionContext context)
        {
            if (context == null)
            {
                return;
            }
            var log = LogFactory.GetLogger(context.Controller.ToString());

            try
            {
                log.LogAll(() => { log.Error(context.Exception); }, () =>
                {
                    LogApp logApp             = new LogApp();
                    LogEntity logEntity       = new LogEntity();
                    logEntity.F_ModuleName    = context.HttpContext.Request.Url.AbsoluteUri;
                    logEntity.F_Type          = context.HttpContext.Request.Path;
                    logEntity.F_Result        = false;
                    logEntity.F_Account       = OperatorProvider.Provider.GetCurrent().UserCode;
                    logEntity.F_NickName      = OperatorProvider.Provider.GetCurrent().UserName;
                    StringBuilder description = new StringBuilder();
                    foreach (string item in context.HttpContext.Request.QueryString.Keys)
                    {
                        description.Append(",");
                        description.Append("\"" + item + "\"");
                        description.Append(":");
                        description.Append("\"" + context.HttpContext.Request.QueryString[item] + "\"");
                    }
                    if (description.Length > 0)
                    {
                        description.Remove(0, 1);
                    }
                    foreach (string item in context.HttpContext.Request.Form.Keys)
                    {
                        description.Append(",");
                        description.Append("\"" + item + "\"");
                        description.Append(":");
                        description.Append("\"" + context.HttpContext.Request.Form[item] + "\"");
                    }
                    if (description.Length > 0)
                    {
                        description.Remove(0, 1);
                    }
                    description.Append("}");
                    description.Insert(0, "{");
                    logEntity.F_Description = description.ToString();
                    logApp.WriteDbLog(logEntity);
                });
            }
            catch (Exception ex) {
            }
        }
コード例 #11
0
ファイル: AppService.cs プロジェクト: guochao2299/LogManage
        public bool RemoveApp(LogApp app)
        {
            if (!m_existingApps.ContainsKey(app.AppGUID))
            {
                throw new Exception(string.Format("要删除的应用程序{0}不存在", app.Name));
            }

            if (DBService.Instance.RemoveApplication(app))
            {
                m_existingApps.Remove(app.AppGUID);
                return(true);
            }

            return(false);
        }
コード例 #12
0
ファイル: ucAudit.cs プロジェクト: guochao2299/LogManage
        public void ResetApp(string appGuid)
        {
            this.DoubleBuffered = true;

            m_app = AppService.Instance.GetApp(appGuid);

            m_suggestText = m_app.Name + "的日志审计";

            this.btnImportNewLogs.Enabled = m_app.IsImportLogsFromFiles;

            InitLogSource();

            //FillComboColumn();

            ReCalculateCommonFilter();
        }
コード例 #13
0
ファイル: AppService.cs プロジェクト: guochao2299/LogManage
        public bool AddApp(LogApp app)
        {
            if (m_existingApps.ContainsKey(app.AppGUID))
            {
                throw new Exception("该应用程序已经存在,不能重复新建!");
            }


            if (DBService.Instance.AddApplication(app))
            {
                m_existingApps.Add(app.AppGUID, (LogApp)app.Clone());
                return(true);
            }

            return(false);
        }
コード例 #14
0
ファイル: AppService.cs プロジェクト: guochao2299/LogManage
        public bool UpdateAppProperties(string appGuid, LogAppMemento app)
        {
            LogApp la = LogApp.NullApplication;

            la.Name = app.LogAppName;
            la.IsImportLogsFromFiles = app.IsImportLogsFromFile;

            if (DBService.Instance.UpdateApplicationProperties(appGuid, la))
            {
                m_existingApps[appGuid].Name = app.LogAppName;
                m_existingApps[appGuid].IsImportLogsFromFiles = app.IsImportLogsFromFile;
                return(true);
            }

            return(false);
        }
コード例 #15
0
ファイル: FormUser.cs プロジェクト: zainu-99/MYAPPCS
        private void ButtonSave_Click(object sender, EventArgs e)
        {
            ModSqlCommand command;

            if (RadioButtonAktif.Checked)
            {
                status = "1";
            }
            else
            {
                status = "0";
            }

            if (RadioButtonMale.Checked)
            {
                gender = "M";
            }
            else
            {
                gender = "P";
            }
            var stream = new MemoryStream();

            PictureBoxProfile.Image.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
            var pic = stream.ToArray();

            if (!ButtonEdit.Enabled)
            {
                command = SqlService.GetCommand("insert into users (userid,name,email,nohp,address,avatar,gender,status,password,password_noencrypt,token)values('" + Utilities.ReplaceQuot(TextBoxUserId.Text) + "', '" + Utilities.ReplaceQuot(TextBoxName.Text) + "', '" + Utilities.ReplaceQuot(TextBoxEmail.Text) + "', '" + Utilities.ReplaceQuot(TextBoxNohp.Text) + "', '" + Utilities.ReplaceQuot(TextBoxAddress.Text) + "', @Pic, '" + gender + "', '" + status + "', '" + Utilities.GetHashMD5(TextBoxPassword.Text) + "', '" + Utilities.ReplaceQuot(TextBoxPassword.Text) + "', '-')");
                command.sqlCommand.Parameters.AddWithValue("@Pic", pic);
                command.sqlCommand.ExecuteNonQuery();
                command.sqlConnection.Close();
                Reload();
                //Fungsi Mengambil data terbaru
                var indexRow = Convert.ToInt32(SqlService.GetDataTable("select top 1 id,name,ROW_NUMBER() OVER(ORDER BY name) as idx from users order by id desc").Rows[0][2]) - 1;
                LogApp.Insert("users", DgvRowToString.Generate(dgv, indexRow), "");
            }
            else
            {
                command = SqlService.GetCommand("update users set userid='" + Utilities.ReplaceQuot(TextBoxUserId.Text) + "',name='" + Utilities.ReplaceQuot(TextBoxName.Text) + "',email='" + Utilities.ReplaceQuot(TextBoxEmail.Text) + "', nohp='" + Utilities.ReplaceQuot(TextBoxNohp.Text) + "', address = '" + Utilities.ReplaceQuot(TextBoxAddress.Text) + "', avatar = @Pic, gender = '" + gender + "', status = '" + status + "', password_noencrypt = '" + Utilities.ReplaceQuot(TextBoxPassword.Text) + "', password = '******' where id = '" + id_user + "'");
                command.sqlCommand.Parameters.AddWithValue("@Pic", pic);
                LogApp.Update("users", DgvRowToString.Generate(dgv, dgv.CurrentRow.Index), "-", "");
                command.sqlCommand.ExecuteNonQuery();
                command.sqlConnection.Close();
                Reload();
            }
        }
コード例 #16
0
        public frmLogViewer(LogApp app, Dictionary <string, List <LogRecord> > lstRecord)
        {
            InitializeComponent();

            this.Text = "浏览从" + app.Name + "的日志文件中读取的日志";

            foreach (string s in lstRecord.Keys)
            {
                LogTable lt = app.GetTable(s);

                LogShowTabPage page = new LogShowTabPage(lt.Name);
                page.ResetCloumns(lt);
                page.SetLogs(lstRecord[s]);

                page.Parent = this.myTabControl1;
            }
        }
コード例 #17
0
 protected virtual ActionResult Success(string message)
 {
     try
     {
         FileLog.LogAll(() => { FileLog.Info(message); }, () =>
         {
             LogApp logApp             = new LogApp();
             LogEntity logEntity       = new LogEntity();
             logEntity.F_ModuleName    = this.HttpContext.Request.Url.AbsoluteUri;
             logEntity.F_Type          = this.HttpContext.Request.Path;
             logEntity.F_Result        = true;
             StringBuilder description = new StringBuilder();
             foreach (string item in this.HttpContext.Request.QueryString.Keys)
             {
                 description.Append(",");
                 description.Append("\"" + item + "\"");
                 description.Append(":");
                 description.Append("\"" + this.HttpContext.Request.QueryString[item] + "\"");
             }
             if (description.Length > 0)
             {
                 description.Remove(0, 1);
             }
             foreach (string item in this.HttpContext.Request.Form.Keys)
             {
                 description.Append(",");
                 description.Append("\"" + item + "\"");
                 description.Append(":");
                 description.Append("\"" + this.HttpContext.Request.Form[item] + "\"");
             }
             if (description.Length > 0)
             {
                 description.Remove(0, 1);
             }
             description.Append("}");
             description.Insert(0, "{");
             logEntity.F_Description = description.ToString();
             logApp.WriteDbLog(logEntity);
         });
     }
     catch { }
     return(Content(new AjaxResult {
         state = ResultType.success.ToString(), message = message
     }.ToJson()));
 }
コード例 #18
0
        private void AddApp2Tree(LogApp app)
        {
            TreeNode tnParent = FindAppGroupNode(app.Group.Name);

            if (tnParent == null)
            {
                MessageBox.Show("没有找到系统所属分组\"" + app.Group.Name + "\",无法将应用程序添加到指定分组");
                return;
            }

            TreeNode tn = new TreeNode(app.Name);

            tn.Tag = app.AppGUID;
            tnParent.Nodes.Add(tn);
            this.tvApps.SelectedNode = tn;

            UpdateAppMenuStatus();
        }
コード例 #19
0
        private void menuNewApp_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                string groupName = string.Empty;

                if (tvApps.SelectedNode != null)
                {
                    TreeNode tnTop = tvApps.SelectedNode;

                    while (tnTop.Parent != null)
                    {
                        tnTop = tnTop.Parent;
                    }

                    groupName = tnTop.Text;
                }

                frmEditAppProperty fe = new frmEditAppProperty(ConstAppValue.DefaultAppName, ConstAppValue.DefaultIsLogsFromFile, groupName);
                fe.Text = "编辑应用程序名称";

                if (CGeneralFuncion.ShowWindow(this, fe, true) == System.Windows.Forms.DialogResult.OK)
                {
                    LogApp la = LogApp.NewApplication;
                    la.Name = fe.EditedName;
                    la.IsImportLogsFromFiles = fe.IsImportLogsFromFile;
                    la.Group = fe.Group;

                    CreateNewAppCommand cmd = new CreateNewAppCommand(la);
                    cmd.UndoDone += new UndoRedoEventHandler(RemoveAppFromTree);
                    cmd.RedoDone += new UndoRedoEventHandler(AddApp2Tree);
                    cmd.Execute();

                    AddCommand(cmd);
                    AddApp2Tree(la);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("创建新工艺失败,错误消息为:" + ex.Message);
            }
        }
コード例 #20
0
        private bool InsertAppStructs()
        {
            try
            {
                foreach (LogApp app in m_apps)
                {
                    if (AppService.Instance.AddApp(LogApp.CreateApp(app.Name, app.AppGUID, app.IsImportLogsFromFiles)))
                    {
                        foreach (LogTable table in app.Tables)
                        {
                            if (AppService.Instance.AddTable(app.AppGUID, LogTable.CreateLogTable(table.Name, table.GUID)))
                            {
                                if (!AppService.Instance.AddTableItems(app.AppGUID, table.GUID, table.Columns))
                                {
                                    throw new Exception(string.Format("应用程序{0}的表{1}插入列出错",
                                                                      new object[] { app.Name, table.Name }));
                                }
                            }
                            else
                            {
                                throw new Exception(string.Format("在应用程序{0}中插入表{1}出错",
                                                                  new object[] { app.Name, table.Name }));
                            }
                        }
                    }
                    else
                    {
                        throw new Exception(string.Format("插入应用程序{0}记录出错", app.Name));
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                throw new Exception("插入日志表结构失败,错误消息为:" + ex.Message);
            }
        }
コード例 #21
0
        private void UpdateAppProperry()
        {
            this.Cursor = Cursors.WaitCursor;
            LogApp la = AppService.Instance.GetApp(Convert.ToString(tvApps.SelectedNode.Tag));

            frmEditAppProperty fe = new frmEditAppProperty(la.Name, la.IsImportLogsFromFiles, la.Group.Name);

            fe.Guid = la.AppGUID;

            if (CGeneralFuncion.ShowWindow(this, fe, true) == System.Windows.Forms.DialogResult.OK)
            {
                string        appGuid          = Convert.ToString(tvApps.SelectedNode.Tag);
                LogAppMemento memento          = new LogAppMemento(fe.IsImportLogsFromFile, fe.EditedName, la.Group.Name);
                UpdateAppPropertiesCommand cmd = new UpdateAppPropertiesCommand(appGuid, memento);
                cmd.UndoDone += new UndoRedoEventHandler(RefreshAppNodeName);
                cmd.RedoDone += new UndoRedoEventHandler(RefreshAppNodeName);

                cmd.Execute();

                AddCommand(cmd);
                RefreshAppNodeName(appGuid, fe.EditedName);
            }
        }
コード例 #22
0
        private void RemoveAppFromTree(LogApp app)
        {
            TreeNode tnParent = FindAppGroupNode(app.Group.Name);

            if (tnParent == null)
            {
                MessageBox.Show("没有找到系统所属分组\"" + app.Group.Name + "\",无法将应用程序删除");
                return;
            }

            for (int i = tnParent.Nodes.Count - 1; i >= 0; i--)
            {
                if (string.Equals(Convert.ToString(tnParent.Nodes[i].Tag), app.AppGUID, StringComparison.OrdinalIgnoreCase))
                {
                    tnParent.Nodes.RemoveAt(i);
                    break;
                }
            }

            this.tvApps.SelectedNode = tnParent;

            UpdateAppMenuStatus();
        }
コード例 #23
0
        static async Task Main(string[] args)
        {
            ILogApp           log  = new LogApp();
            ConfigurationJson json = new ConfigurationJson(log);

            Config config = await json.Load();

            if (config != null)
            {
                LoadSchema schema = new LoadSchema(log);
                if (schema.AddPath(config.PathXSD) != false)
                {
                    XmlSchemaSet schemaSet = schema.AddSchema();
                    CheckXML     checkXML  = new CheckXML(schemaSet, log);

                    if (checkXML.addPath(config.PathXML) != false)
                    {
                        checkXML.CheckXml(config.PathMove);
                    }
                }
            }
            log.WriteLog(LogLevel.Info, $"Complite! (Press any key)");
            Console.ReadKey();
        }
コード例 #24
0
 public DeleteAppCommand(LogApp la)
 {
     m_newData = (LogApp)la.Clone();
 }
コード例 #25
0
 public CreateNewAppCommand(LogApp la)
 {
     m_newData = (LogApp)la.Clone();
 }
コード例 #26
0
        public void insertTaskMember(List <TaskMemberDataEntity> ents, string bid)
        {
            LogApp logApp = new LogApp();

            foreach (var ent in ents)
            {
                rep.Insert(ent);
            }

            /*logApp.WriteDbLog(new LogEntity()
             * {
             *  F_Account = "",
             *  F_CreatorTime = System.DateTime.Now,
             *  F_Date = System.DateTime.Now,
             *  F_CreatorUserId = "",
             *  F_Description = "StartSend",
             *  F_Id = System.Guid.NewGuid().ToString(),
             *  F_ModuleId = "SendMessage",
             *  F_ModuleName = "SendMessage",
             *
             *
             * });
             */
            try
            {
                var shops = ents.GroupBy(p => p.shopCode);
                foreach (var shop in shops)
                {
                    string ShopCode = shop.Key;


                    var salesApp = new marketSalesApp();
                    var users    = salesApp.getGuidManByShop(ShopCode);
                    foreach (var user in users)
                    {
                        var            userinfo = salesApp.getUserInfoBySalesNo(user.sales_No);
                        string         taskId   = System.Guid.NewGuid().ToString();
                        TaskMastEntity ent      = new TaskMastEntity()
                        {
                            id                      = taskId,
                            alertType               = 1,
                            createdTime             = System.DateTime.Now,
                            createdUserId           = userinfo.id,
                            MESSAGE_BILL_NO         = bid,
                            MESSAGE_SUB_NO          = 0,
                            MESSAGE_REPLY_TYPE_CODE = "001",
                            MESSAGE_REPLY_TYPE_NAME = "不需回复",
                            RECEIVE_EMPLOYEE_CODE   = user.sales_No,
                            RECEIVE_EMPLOYEE_NAME   = user.sales_Name,
                            desc                    = "有会员进店,请接待",
                            freqType                = 1,
                            taskName                = "有会员进店,请接待",
                            starTime                = System.DateTime.Now,
                            endTime                 = System.DateTime.Now.AddMinutes(5),
                            importantType           = 1,
                            isAll                   = 1,
                            isRead                  = 0,
                            isReply                 = 0,

                            taskType          = "009",
                            taskTypeName      = "会员到店通知",
                            URGENCY_TYPE_CODE = "002",
                            URGENCY_TYPE_NAME = "紧急",
                            taskSource        = "系统",
                            isDelete          = 0,
                            taskUrl           = "{'shopCode':'" + ShopCode + "','bid':'" + bid + "'}"
                        };
                        taskRep.Insert(ent);

                        TaskPopApp popApp = new TaskPopApp();
                        popApp.createTaskPop(new TaskPopEntity()
                        {
                            id = System.Guid.NewGuid().ToString(), status = 2, taskId = taskId, UserId = userinfo.id, userType = 1
                        });


                        string AndroIdDevice = getDeviceTokens(userinfo.id, "Android");
                        if (AndroIdDevice.Length > 0)
                        {
                            AndroidPostJson postJson = new AndroidPostJson();
                            var             payload  = new AndroidPayload();
                            postJson.type          = CastType.listcast;
                            postJson.device_tokens = AndroIdDevice;

                            payload.display_type      = "notification";
                            payload.body              = new ContentBody();
                            payload.body.ticker       = ent.taskName;
                            payload.body.title        = ent.taskName;
                            payload.body.icon         = "appicon";
                            payload.body.play_lights  = "true";
                            payload.body.play_sound   = "true";
                            payload.body.play_vibrate = "true";
                            payload.body.text         = ent.taskName;
                            payload.body.after_open   = AfterOpenAction.go_app;
                            //payload.body.custom = "comment-notify";
                            var dic = new Dictionary <string, string>();
                            dic.Add("messageId", System.Guid.NewGuid().ToString());

                            payload.extra        = dic;
                            postJson.payload     = payload;
                            postJson.description = ent.taskName;
                            UMengMessagePush <AndroidPostJson> uMAndroidPush = new UMengMessagePush <AndroidPostJson>("59550725677baa17ce0003fe", "grpqx0ayqc1ovn45iqczlrovqrdtvujf");
                            ReturnJsonClass resu = uMAndroidPush.SendMessage(postJson);
                            foreach (var memberEnt in ents)
                            {
                                postJson               = new AndroidPostJson();
                                payload                = new AndroidPayload();
                                postJson.type          = CastType.unicast;
                                postJson.device_tokens = AndroIdDevice;

                                payload.display_type      = "notification";
                                payload.body              = new ContentBody();
                                payload.body.ticker       = ent.taskName;
                                payload.body.title        = ent.taskName;
                                payload.body.icon         = "appicon";
                                payload.body.play_lights  = "true";
                                payload.body.play_sound   = "true";
                                payload.body.play_vibrate = "true";
                                payload.body.text         = ent.taskName;
                                payload.body.after_open   = AfterOpenAction.go_app;
                                dic = new Dictionary <string, string>();
                                dic.Add("messageId", System.Guid.NewGuid().ToString());
                                dic.Add("mfMemberId", memberEnt.mfMemberId);
                                dic.Add("bid", bid);

                                payload.extra               = dic;
                                postJson.payload            = payload;
                                postJson.policy             = new AndroidPolicy();
                                postJson.policy.expire_time = DateTime.Now.AddMinutes(5).ToString("yyyy-MM-dd HH:mm:ss");
                                UMengMessagePush <AndroidPostJson> uMAndroidPush2 = new UMengMessagePush <AndroidPostJson>("5b3ae2eaf43e4808f6000112", "gljoyn3tebkcchaeyvksvp0itjagynqr");
                                ReturnJsonClass resu2 = uMAndroidPush2.SendMessage(postJson);

                                /*logApp.WriteDbLog(new LogEntity()
                                 * {
                                 *  F_Account = user.sales_No,
                                 *  F_CreatorTime = System.DateTime.Now,
                                 *  F_Date = System.DateTime.Now,
                                 *  F_CreatorUserId = user.sales_No,
                                 *  F_Description = resu2.ret,
                                 *  F_Id = System.Guid.NewGuid().ToString(),
                                 *  F_ModuleId = "SendMessage",
                                 *  F_ModuleName = "SendMessage",
                                 *
                                 * });*/
                            }

                            System.Console.WriteLine(resu.ret);
                        }
                        string IOSDevice = getDeviceTokens(userinfo.id, "IOS");
                        if (IOSDevice.Length > 0)
                        {
                            IOSPostJson postJson = new IOSPostJson();
                            postJson.type = CastType.unicast;
                            var aps = new Aps()
                            {
                                alert = "msg",
                                sound = "default"
                            };
                            var     payload = new IOSPayload(aps);
                            JObject jo      = JObject.FromObject(payload);
                            var     extra   = new Dictionary <string, string>();
                            //用户自定义内容,"d","p"为友盟保留字段,key不可以是"d","p"
                            extra.Add("open", "list");
                            extra.ToList().ForEach(x => jo.Add(x.Key, x.Value));

                            postJson.payload         = jo;
                            postJson.description     = ent.taskName;
                            postJson.device_tokens   = IOSDevice;
                            postJson.production_mode = "true";

                            UMengMessagePush <IOSPostJson> uMAndroidPush = new UMengMessagePush <IOSPostJson>("596791cbb27b0a673700001f", "siy2v7u9uzishzimgnslzdukyqkeofhp");
                            ReturnJsonClass resu = uMAndroidPush.SendMessage(postJson);
                            System.Console.WriteLine(resu.ret);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                logApp.WriteDbLog(new LogEntity()
                {
                    F_Account       = "",
                    F_CreatorTime   = System.DateTime.Now,
                    F_Date          = System.DateTime.Now,
                    F_CreatorUserId = "",
                    F_Description   = ex.Message,
                    F_Id            = System.Guid.NewGuid().ToString(),
                    F_ModuleId      = "SendMessage",
                    F_ModuleName    = "SendMessage",
                });
            }
        }
コード例 #27
0
 private void ExportAppIdentity(string fileName)
 {
     LogApp la = AppService.Instance.GetApp(Convert.ToString(tvApps.SelectedNode.Tag));
 }
コード例 #28
0
 public LoginController(UserApp userApp, LogApp logApp)
 {
     this.userApp = userApp;
     this.logApp  = logApp;
 }
コード例 #29
0
 public LogsController(LogRepository logRepository, LogApp logApp)
 {
     _logRepository = logRepository;
     _logApp        = logApp;
 }
コード例 #30
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!IsAnyLogTableSelected())
            {
                MessageBox.Show("请先选中要导入结构的日志表");
            }

            SaveFileDialog sfd = new SaveFileDialog();

            sfd.FileName = "日志表结构.xml";
            sfd.Filter   = "xml 文件(*.xml)|*.xml";

            if (sfd.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            {
                lblStatus.Text = sfd.FileName;
                XmlTextWriter writer = null;

                try
                {
                    List <LogApp>   lstApps   = new List <LogApp>();
                    List <LogTable> lstTables = null;

                    foreach (TreeNode tn in this.treeView1.Nodes)
                    {
                        lstTables = null;
                        string appGuid = Convert.ToString(tn.Tag);

                        foreach (TreeNode tnSon in tn.Nodes)
                        {
                            if (tnSon.Checked)
                            {
                                if (lstTables == null)
                                {
                                    lstTables = new List <LogTable>();
                                }

                                string tableGuid = Convert.ToString(tnSon.Tag);

                                LogTable table = (LogTable)AppService.Instance.GetAppTable(appGuid, tableGuid).Clone();

                                foreach (LogTableItem item in table.Columns)
                                {
                                    item.ColumnName = LogColumnService.Instance.GetColumnName(item.LogColumnIndex);
                                }

                                lstTables.Add(table);
                            }
                        }

                        if (lstTables != null)
                        {
                            LogApp srcApp = AppService.Instance.GetApp(appGuid);
                            LogApp app    = LogApp.CreateApp(srcApp.Name, srcApp.AppGUID, srcApp.IsImportLogsFromFiles);
                            app.Tables.AddRange(lstTables);
                            lstApps.Add(app);

                            lstTables = null;
                        }
                    }

                    writer = new XmlTextWriter(sfd.FileName, Encoding.Default);
                    XmlSerializer serializer = new XmlSerializer(typeof(List <LogApp>));
                    serializer.Serialize(writer, lstApps);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("导出日志表结构失败,错误消息为:" + ex.Message);
                }
                finally
                {
                    if (writer != null)
                    {
                        writer.Close();
                    }
                }
            }
        }