Пример #1
0
        private void UploadViedo(List <MessageType> message, List <WXMesssage> wxMsgList)
        {
            WXMesssage msg       = new WXMesssage();
            var        sendVideo = message.Where(a => a.SendType == "视频").FirstOrDefault();

            if (null != sendVideo)
            {
                if (!File.Exists(sendVideo.TxtContent))
                {
                    MetroMessageBox.Show(this, "文件不存在,请选择好文件!!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                MessageTypeServices svc = new MessageTypeServices();
                var result = svc.SetMessgeSendCount(sendVideo.Id);
                if (result.Code != ResultCodeEnums.success)
                {
                    MetroMessageBox.Show(this, result.Msg, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                WXServices wxServices = new WXServices();
                ExecEven("正在上传文件到微信服务器.........", null);
                var resultJson = wxServices.UploadVideo(sendVideo.TxtContent, _me.UserName, contact_all[0].UserName);
                if (!string.IsNullOrEmpty(resultJson))
                {
                    JObject obj = JsonConvert.DeserializeObject(resultJson) as JObject;
                    msg.MediaId = obj["MediaId"].ToString();
                    msg.Type    = 43;
                    msg.Readed  = false;
                    msg.Time    = DateTime.Now;
                    msg.From    = _me.UserName;
                    wxMsgList.Add(msg);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// 保存信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void metroButton1_Click(object sender, EventArgs e)
        {
            MessageTypeServices sevice = new MessageTypeServices();
            var data = GetGradMessage(true);

            if (data.Count <= 0)
            {
                return;
            }
            sevice.SetMessageRemote(data);
            ServiceRecordSvc svc = new ServiceRecordSvc();

            svc.SetRecord();
            GridMessageContent.DataSource = sevice.GetNewMessageRemote();
        }
Пример #3
0
        /// <summary>
        /// 初始化窗体
        /// </summary>
        private void FromInit()
        {
            this.checkMale.Checked   = true;
            this.CheckFemale.Checked = true;
            MessageTypeServices sevice = new MessageTypeServices();

            GridMessageContent.DataSource = sevice.GetNewMessageRemote();
            List <City> cityList = AllCity.allCityData;
            var         data     = cityList.Where(a => a.Pid == 0).ToList();

            data.Insert(0, new City()
            {
                Id = 0, Name = "全部"
            });
            cmbSheng.DataSource    = data;
            cmbSheng.ValueMember   = "Id";
            cmbSheng.DisplayMember = "Name";
            cmbSheng.SelectedIndex = 0;
            var data2 = new List <City>();

            data2.Insert(0, new City()
            {
                Id = 0, Name = "全部"
            });
            cmbShi.DataSource    = data2;
            cmbShi.ValueMember   = "Id";
            cmbShi.DisplayMember = "Name";
            cmbShi.SelectedIndex = 0;
            ServiceRecordSvc svc = new ServiceRecordSvc();
            //var Authdata = svc.IsAuth();
            //ServiceRecord rec = (ServiceRecord)Authdata.Data;
            //lblDate.Text = rec.ExpireDate.GetDateTimeFormats('f')[0].ToString();
            MachineSvc mcSvc = new MachineSvc();
            var        key   = mcSvc.Get().MachineCode;

            lblMCCode.Text   = key;
            lblUserName.Text = "软件试用期";
            //if (Authdata.Code == ResultCodeEnums.Auth)
            // {
            // lblUserName.Text = GetAESInfo.Get(rec.SurplusTotal, key);
            lblAuthCartic.Visible = false;
            txtAuthCard.Visible   = false;
            btnAuth.Visible       = false;
            //}
        }
Пример #4
0
        private void SetText(List <MessageType> message, List <WXMesssage> wxMsgList)
        {
            var sendMsg = message.Where(a => a.SendType == "文本").FirstOrDefault();

            if (null != sendMsg)
            {
                MessageTypeServices svc = new MessageTypeServices();
                var result = svc.SetMessgeSendCount(sendMsg.Id);
                if (result.Code != ResultCodeEnums.success)
                {
                    MetroMessageBox.Show(this, result.Msg, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                WXMesssage msg = new WXMesssage();
                msg.Type   = 1;
                msg.Msg    = WXFace.AddFace(sendMsg.TxtContent);
                msg.Readed = false;
                msg.Time   = DateTime.Now;
                msg.From   = _me.UserName;
                wxMsgList.Add(msg);
            }
        }