/// <summary>
        /// 保存操作
        /// </summary>
        public void Save()
        {
            MessageAlert alert    = new MessageAlert();
            Loading      ld       = new Loading();
            string       tempText = txtTempText.Text;

            ((Action)(delegate()
            {
                if (LogicUser.Instance.AddUserSendTemplate(MyUserInfo.LoginToken, tempText))
                {
                    alert.Message = "保存成功";
                }
                else
                {
                    alert.Message = "保存失败";
                }
                ld.CloseForm();
                this.BeginInvoke((Action)(delegate()
                {
                    MyUserInfo.sendtemplate = tempText;
                    alert.ShowDialog(this);
                }));
            })).BeginInvoke(null, null);
            ld.ShowDialog(this);
        }
Esempio n. 2
0
        private void ShowAlert(string Message)
        {
            MessageAlert alert = new MessageAlert();

            alert.Message = Message;
            alert.ShowDialog(this);
        }
Esempio n. 3
0
        private void ShowAlert(string Message, OKEventHandler handler)
        {
            MessageAlert alert = new MessageAlert();

            alert.Message   = Message;
            alert.CallBack += handler;
            alert.ShowDialog(this);
        }
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            MyUserInfo.filterUserGroups = txtUserfilter.Text;
            writeLocalFile(MyUserInfo.filterUserGroups);
            MessageAlert alert = new MessageAlert("保存成功");

            alert.ShowDialog(this);
        }
Esempio n. 5
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtKeyword.Text))
            {
                txtKeyword.Focus();
                return;
            }
            if (ckbAutoText.Checked)
            {
                if (string.IsNullOrEmpty(txtReplyContent.Text))
                {
                    txtReplyContent.Focus();
                    return;
                }
            }
            int flag      = 0;
            int replyType = 0;

            if (ckbAutoText.Checked)
            {
                replyType = 0;
            }
            if (ckbAutoGoods.Checked)
            {
                replyType = 1;
            }


            string keyword = txtKeyword.Text;
            string content = txtReplyContent.Text;

            MessageAlert alert = new MessageAlert();
            Loading      ld    = new Loading();

            ((Action)(delegate()
            {
                flag = LogicUser.Instance.AddReplyKeyword(MyUserInfo.LoginToken, keyword, content, replyType, 0) ? 1 : 0;
                ld.CloseForm();
                if (flag > 0)
                {
                    alert.Message = "添加成功";
                }
                else
                {
                    alert.Message = "添加失败,请稍候再试!";
                }
                this.BeginInvoke((Action)(delegate()
                {
                    alert.ShowDialog(this);
                    if (flag > 0)
                    {
                        hotControl.LoadDgvKeyword();
                        this.Close();
                    }
                }));
            })).BeginInvoke(null, null);
            ld.ShowDialog(hotForm);
        }
 private void ShowAlert(string text)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new Action <string>(ShowAlert), new object[] { text });
     }
     else
     {
         MessageAlert alert = new MessageAlert(text);
         alert.ShowDialog(this);
     }
 }
 /// <summary>
 /// 关闭
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 private void pbClose_Click(object sender, EventArgs e)
 {
     if (!BuildStart)
     {
         this.Close();
     }
     else
     {
         MessageAlert alert = new MessageAlert("正在生成发送内容,请稍后!");
         alert.ShowDialog(this);
     }
 }
Esempio n. 8
0
 public void Alert(string text, string title = "提示")
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new Action <string, string>(Alert), new object[] { text, title });
     }
     else
     {
         MessageAlert alert = new MessageAlert(text, title);
         alert.StartPosition = FormStartPosition.CenterScreen;
         alert.ShowDialog();
     }
 }
Esempio n. 9
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            MessageAlert alert = new MessageAlert();
            Loading      ld    = new Loading();

            ((Action)(delegate()
            {
                hotForm.myConfig.enable_autoremove = ckbAutoRemove.Checked ? 1 : 0;

                AutoRemoveUserWhereModel auto_remove_user_where = new AutoRemoveUserWhereModel();
                auto_remove_user_where.enable_send_text = ckbSendMessage.Checked ? 1 : 0;
                auto_remove_user_where.enable_send_image = ckbSendImage.Checked ? 1 : 0;
                auto_remove_user_where.enable_share_card = ckbSendCard.Checked ? 1 : 0;
                auto_remove_user_where.enable_share_link = ckbSendLink.Checked ? 1 : 0;

                int result = 0;

                int.TryParse(txtSendImageCount.Text, out result);
                auto_remove_user_where.send_image_count = result > 0 ? result : 2;

                //发送文本的长度
                int.TryParse(txtSendTextLenght.Text, out result);
                auto_remove_user_where.send_text_lenght = result > 0 ? result : 20;

                ConfigWhereModel cfgWhere = string.IsNullOrEmpty(hotForm.myConfig.where_config) ? null : JsonConvert.DeserializeObject <ConfigWhereModel>(hotForm.myConfig.where_config);

                cfgWhere.auto_remove_user_where = JsonConvert.SerializeObject(auto_remove_user_where);

                hotForm.myConfig.where_config = JsonConvert.SerializeObject(cfgWhere);
                int flag = LogicUser.Instance.AddUserConfigModel(MyUserInfo.LoginToken, hotForm.myConfig);

                ld.CloseForm();
                this.BeginInvoke((Action)(delegate()   //等待结束
                {
                    alert.Message = flag > 0 ? "保存成功" : "保存失败";
                    alert.ShowDialog(this);
                }));
            })).BeginInvoke(null, null);
            ld.ShowDialog(hotForm);
        }
        ///// <summary>
        ///// 记住密码
        ///// </summary>
        //private void RememberPassword(string pwdStr)
        //{
        //    string filePath = System.IO.Path.Combine(Application.StartupPath, GlobalConfig.dbpath);
        //    if (!Directory.Exists(filePath))
        //        Directory.CreateDirectory(filePath);
        //    filePath += ConstConfig.conf_user;
        //    if (!File.Exists(filePath))
        //        File.Create(filePath).Dispose();
        //    StreamWriter sw = new StreamWriter(@filePath, false);
        //    sw.Write(pwdStr);
        //    sw.Close();//写入
        //}

        //private void ckbAutoLogin_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (ckbAutoLogin.Checked)
        //        ckbSavePwd.Checked = true;
        //}


        private void ShowAlert(string content)
        {
            MessageAlert alert = new MessageAlert(content);

            alert.ShowDialog(this);
        }
Esempio n. 11
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtWeChatTitle.Text))
            {
                txtWeChatTitle.Focus();
                return;
            }
            MessageAlert alert = new MessageAlert();
            //Loading ld = new Loading();
            SetAutoReplyControl   replyControl      = hotAutoForm as SetAutoReplyControl;
            SetAutoRemoveChatroom autoRemoveControl = hotAutoForm as SetAutoRemoveChatroom;
            SendMessage           sendControl       = hotAutoForm as SendMessage;
            string groupTitle = txtWeChatTitle.Text;
            string groupPid   = txtPid.Text;

            ((Action)(delegate()
            {
                int flag = 0;
                UserWechatListModel data = new UserWechatListModel();
                if (hotTask != null)
                {
                    //data = LogicUser.Instance.UpdateUserWeChatTitle(MyUserInfo.LoginToken, editId, txtWeChatTitle.Text);

                    if (LogicHotTao.Instance(MyUserInfo.currentUserId).UpdateUserWeChatTitle(MyUserInfo.currentUserId, editId, groupTitle, groupPid))
                    {
                        data.pid = groupPid;
                        data.wechattitle = groupTitle;
                        flag = 1;
                    }
                }
                else if (replyControl != null || sendControl != null)
                {
                    flag = LogicUser.Instance.UpdateUserWeChatTitle(MyUserInfo.LoginToken, txtWeChatTitle.Text, 0);
                }
                else if (autoRemoveControl != null)
                {
                    flag = LogicUser.Instance.UpdateUserWeChatTitle(MyUserInfo.LoginToken, txtWeChatTitle.Text, 1);
                }


                if (flag > 0)
                {
                    alert.Message = "保存成功";
                }
                else
                {
                    alert.Message = "保存失败,请检查是否重复";
                }

                //ld.CloseForm();
                this.BeginInvoke((Action)(delegate()
                {
                    alert.ShowDialog(this);
                    if (flag > 0)
                    {
                        if (hotTask != null)
                        {
                            //hotTask.SetPidView(data, editId > 0 ? CurrentRowIndex : -1);
                            hotTask.loadUserPidGridView();
                        }
                        else
                        {
                            if (replyControl != null)
                            {
                                replyControl.LoadDgvChatRoom();
                                if (hotForm.wxlogin != null)
                                {
                                    hotForm.wxlogin.LoadAutoHandleData();
                                }
                            }
                            else if (autoRemoveControl != null)
                            {
                                autoRemoveControl.LoadDgvChatRoom();
                            }
                            else if (sendControl != null)
                            {
                                sendControl.LoadDgvChatRoom();
                                if (hotForm.wxlogin != null)
                                {
                                    hotForm.wxlogin.LoadAutoHandleData();
                                }
                            }
                        }
                        this.Close();
                    }
                }));
            })).BeginInvoke(null, null);
            //ld.ShowDialog(hotForm);
        }
Esempio n. 12
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            MessageAlert alert = new MessageAlert();

            if (string.IsNullOrEmpty(txtTaskTitle.Text))
            {
                alert.Message = "请输入任务标题";
                alert.ShowDialog(this);
                txtTaskTitle.Focus();
                return;
            }

            if (string.IsNullOrEmpty(txtStartTime.Text))
            {
                txtStartTime.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtEndTime.Text))
            {
                txtEndTime.Focus();
                return;
            }
            string goodsText = JsonConvert.SerializeObject(hotGoodsText);
            string pidsText  = JsonConvert.SerializeObject(hotPidsText);

            TaskPlanModel model = new TaskPlanModel()
            {
                userid    = MyUserInfo.currentUserId,
                title     = txtTaskTitle.Text,
                startTime = Convert.ToDateTime(txtStartTime.Text),
                endTime   = Convert.ToDateTime(txtEndTime.Text),
                pidsText  = pidsText,
                goodsText = goodsText,
                id        = taskid
            };
            Loading ld = new Loading();

            ((Action)(delegate()
            {
                //TaskPlanModel data = LogicTaskPlan.Instance.addTaskPlan(MyUserInfo.LoginToken, model);
                TaskPlanModel data = LogicHotTao.Instance(MyUserInfo.currentUserId).AddUserTaskPlan(model);
                ld.CloseForm();
                if (data != null)
                {
                    this.BeginInvoke((Action)(delegate()   //等待结束
                    {
                        if (hotTask != null)
                        {
                            hotTask.SetTaskView(data, taskid > 0 ? CurrentRowIndex : -1);
                        }

                        if (hotHistoryTask != null)
                        {
                            hotHistoryTask.LoadTaskPlanGridView();
                        }

                        txtTaskTitle.Clear();
                        alert.Message = "保存成功";
                        alert.CallBack += () => { this.Close(); };
                        alert.ShowDialog(this);
                    }));
                }
                else
                {
                    this.BeginInvoke((Action)(delegate()   //等待结束
                    {
                        alert.Message = "保存失败";
                        alert.ShowDialog(this);
                    }));
                }
            })).BeginInvoke(null, null);
            ld.ShowDialog(hotForm);
        }
Esempio n. 13
0
        public void Save()
        {
            int     result  = 0;
            decimal result2 = 0;

            hotForm.myConfig.userid = MyUserInfo.currentUserId;
            ConfigSendTimeModel cfgTime = string.IsNullOrEmpty(hotForm.myConfig.send_time_config) ? new ConfigSendTimeModel() : JsonConvert.DeserializeObject <ConfigSendTimeModel>(hotForm.myConfig.send_time_config);

            cfgTime = cfgTime == null ? new ConfigSendTimeModel() : cfgTime;


            //淘宝API
            cfgTime.appkey    = txtTaoAppKey.Text;
            cfgTime.appsecret = txtTaoAppSecret.Text;


            //商品间隔
            int.TryParse(txtgoodsinterval.Text, out result);
            cfgTime.goodsinterval = result < 0 ? 35 : result;

            //操作间隔
            decimal result3 = 0;

            decimal.TryParse(txthandleInterval.Text, out result3);
            cfgTime.hdInterval = result3 == 0 ? 1 : result3;

            //任务间隔
            int.TryParse(txtTaskInterval.Text, out result);
            cfgTime.taskinterval = result == 0 ? 30 : result;
            //图文顺序
            cfgTime.imagetextsort = rbTwSort.Checked ? 0 : 1;

            //发送模式
            cfgTime.sendmode = rdSendWindows.Checked ? 0 : 1;

            MyUserInfo.sendmode = cfgTime.sendmode;

            //过滤条件
            ConfigWhereModel cfgWhere = string.IsNullOrEmpty(hotForm.myConfig.where_config) ? new ConfigWhereModel() : JsonConvert.DeserializeObject <ConfigWhereModel>(hotForm.myConfig.where_config);

            cfgWhere = cfgWhere == null ? new ConfigWhereModel() : cfgWhere;

            //优惠券过期
            cfgWhere.minCouponDateDayCountEnable = ckbminCouponDayCount.Checked ? 1 : 0;
            int.TryParse(txtminCouponDateDayCount.Text, out result);
            cfgWhere.minCouponDateDayCount = result;

            //优惠券数量
            cfgWhere.minCouponAmountEnable = ckbCoupon.Checked ? 1 : 0;
            int.TryParse(txtminCouponAmount.Text, out result);
            cfgWhere.minCouponAmount = result;

            //月销量
            cfgWhere.minMonthSalesAmountEnable = ckbMonthSales.Checked ? 1 : 0;
            int.TryParse(txtminMonthSalesAmount.Text, out result);
            cfgWhere.minMonthSalesAmount = result;


            //佣金比率
            cfgWhere.minCmsRateAmountEnable = ckbCmsRate.Checked ? 1 : 0;
            decimal.TryParse(txtminCmsRateAmount.Text, out result2);
            cfgWhere.minCmsRateAmount = result2;

            //商品价格
            cfgWhere.GoodsPriceEnable = ckbGoodsPrice.Checked ? 1 : 0;
            decimal.TryParse(txtminGoodsPrice.Text, out result2);
            cfgWhere.minGoodsPrice = result2;
            decimal.TryParse(txtmaxGoodsPrice.Text, out result2);
            cfgWhere.maxGoodsPrice = result2;

            //过滤今日重复商品
            cfgWhere.filterGoodsEnable = ckbfilterGoods.Checked ? 1 : 0;

            ConfigModel myConfig = hotForm.myConfig;

            myConfig.send_time_config = JsonConvert.SerializeObject(cfgTime);
            myConfig.where_config     = JsonConvert.SerializeObject(cfgWhere);

            MessageAlert alert = new MessageAlert();
            Loading      ld    = new Loading();

            ((Action)(delegate()
            {
                if (LogicUser.Instance.AddUserConfigModel(MyUserInfo.LoginToken, hotForm.myConfig) > 0)
                {
                    alert.Message = "保存成功";
                }
                else
                {
                    alert.Message = "保存失败,请重试";
                }
                ld.CloseForm();
                this.BeginInvoke((Action)(delegate()
                {
                    hotForm.myConfig = myConfig;
                    alert.ShowDialog(this);
                }));
            })).BeginInvoke(null, null);
            ld.ShowDialog(this);
        }
Esempio n. 14
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            MessageAlert alert = new MessageAlert();

            if (!isJoinImage && string.IsNullOrEmpty(txtTaskTitle.Text))
            {
                alert.Message = "请输入任务标题";
                alert.ShowDialog(this);
                txtTaskTitle.Focus();
                return;
            }
            else
            {
                if (txtTaskTitle.Text.Length > 8)
                {
                    alert.Message = "商品简述最多8个字";
                    alert.ShowDialog(this);
                    txtTaskTitle.Focus();
                    return;
                }
            }
            if (string.IsNullOrEmpty(txtStartTime.Text))
            {
                txtStartTime.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtEndTime.Text))
            {
                txtEndTime.Focus();
                return;
            }
            string goodsText = JsonConvert.SerializeObject(hotGoodsText);
            string pidsText  = JsonConvert.SerializeObject(hotPidsText);

            TaskPlanModel model = new TaskPlanModel()
            {
                userid    = MyUserInfo.currentUserId,
                title     = isJoinImage ? "【合成图片转发】" + txtTaskTitle.Text : txtTaskTitle.Text,
                startTime = Convert.ToDateTime(txtStartTime.Text),
                endTime   = Convert.ToDateTime(txtEndTime.Text),
                pidsText  = pidsText,
                goodsText = goodsText,
                id        = taskid,
                status    = 0,
                isTpwd    = isJoinImage ? 1 : 0
            };
            Loading ld = new Loading();

            ((Action)(delegate()
            {
                TaskPlanModel data = LogicHotTao.Instance(MyUserInfo.currentUserId).AddUserTaskPlan(model);

                if (data != null)
                {
                    if (isJoinImage)
                    {
                        BuildText(Convert.ToInt32(data.id));
                    }
                    ld.CloseForm();
                    this.BeginInvoke((Action)(delegate()   //等待结束
                    {
                        if (hotTask != null)
                        {
                            //hotTask.SetTaskView(data, taskid > 0 ? CurrentRowIndex : -1);
                            hotTask.LoadTaskPlanGridView();
                        }
                        txtTaskTitle.Clear();
                        alert.Message = "保存成功";
                        alert.CallBack += () => { this.Close(); };
                        alert.ShowDialog(this);
                    }));
                }
                else
                {
                    ld.CloseForm();
                    this.BeginInvoke((Action)(delegate()   //等待结束
                    {
                        alert.Message = "保存失败";
                        alert.ShowDialog(this);
                    }));
                }
            })).BeginInvoke(null, null);
            ld.ShowDialog(hotForm);
        }