コード例 #1
0
        /// <summary>
        ///  查询自定义菜单操作
        /// </summary>
        /// <param name="accessToken">accessToken</param>
        /// Author  : 俞立钢
        /// Company : 绍兴标点电子技术有限公司
        /// Created : 2014-10-16 10:25:32
        private void CreateMenu(string accessToken)
        {
            string url = string.Format("https://api.weixin.qq.com/cgi-bin/menu/create?access_token={0}", accessToken);

            MenuCreate.Text = PublicFun.RequestUpDownData(url, HttpMethod.Post, MenuCreate.Text);
        }
コード例 #2
0
        /// <summary>
        ///  查询自定义菜单操作
        /// </summary>
        /// <param name="accessToken">accessToken</param>
        /// Author  : 俞立钢
        /// Company : 绍兴标点电子技术有限公司
        /// Created : 2014-10-16 10:25:32
        private void SelectMenu(string accessToken)
        {
            string url = string.Format("https://api.weixin.qq.com/cgi-bin/menu/get?access_token={0}", accessToken);

            MenuSelect.Text = PublicFun.RequestUpDownData(url, HttpMethod.Get, "");
        }
コード例 #3
0
        /// <summary>
        ///  上传多媒体文件
        /// </summary>
        /// Author  : 俞立钢
        /// Company : 绍兴标点电子技术有限公司
        /// Created : 2014-10-18 15:14:19
        private void DoUploadFile(string accessToken)
        {
            string httpUrl = string.Format("http://file.api.weixin.qq.com/cgi-bin/media/upload?access_token={0}&type={1}", accessToken, "image");

            TxtUploadResult.Text = PublicFun.RequestUploadFile(httpUrl, HttpMethod.Post.ToString(), TxtUploadUrl.Text);
        }
コード例 #4
0
ファイル: PC07.cs プロジェクト: gaoge00/TianMaSystem
 private void WinFMD010_KeyDown(object sender, KeyEventArgs e)
 {
     PublicFun.EnterSendTab(sender, e);
 }
コード例 #5
0
ファイル: PC07.cs プロジェクト: gaoge00/TianMaSystem
        //保存按钮
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtGYSMC.Text.strReplace().IsNullOrEmpty())
            {
                ComForm.DspMsg("W002", "供应商名称");
                txtGYSMC.Focus();
                return;
            }

            if (DBHelper.Exists(TableName, "and GYSMC='" + txtGYSMC.Text.strReplace() + "'"))
            {
                ComForm.DspMsg("W068", "供应商名称");
                txtGYSMC.Focus();
                return;
            }
            if (ComConst.LING == ComForm.DspMsg("Q004", ""))
            {
                try
                {
                    Model.fmd030 _modelFMD030 = new Model.fmd030();
                    _modelFMD030.ID      = iID;
                    _modelFMD030.GYSMC   = txtGYSMC.Text.strReplace();
                    _modelFMD030.GYSSLMC = txtGYSSLMC.Text.strReplace();
                    _modelFMD030.DZ      = txtDZ.Text.strReplace();
                    _modelFMD030.DH      = txtDH.Text.strReplace();
                    _modelFMD030.LXR     = txtLXR.Text.strReplace();
                    if (_modelFMD030.ID != -1)
                    {
                        //更新数据
                        _modelFMD030.GXZBH = ComForm.strUserName;
                        _modelFMD030.GXR   = PublicFun.GetSystemDateTime(Const.Date, Const.dateStyle_YMD);
                        _modelFMD030.GXSJ  = PublicFun.GetSystemDateTime(Const.Time, string.Empty);
                        _modelFMD030.GXDMM = systemdate.Get_SysDNBH();
                        DbHelperMySql.ExecuteSql(DBHelper.Update(TableName, _modelFMD030, " and ID=" + _modelFMD030.ID + ""));

                        //_bllFMD030.Update(_modelFMD030);
                        ComForm.DspMsg("M002", "");
                        txtGYSMC.Focus();
                    }
                    else
                    {
                        //插入数据
                        _modelFMD030.ID    = null;
                        _modelFMD030.RLZBH = ComForm.strUserName;
                        _modelFMD030.RLR   = PublicFun.GetSystemDateTime(Const.Date, Const.dateStyle_YMD);
                        _modelFMD030.RLSJ  = PublicFun.GetSystemDateTime(Const.Time, string.Empty);
                        _modelFMD030.RLDMM = systemdate.Get_SysDNBH();
                        DbHelperMySql.ExecuteSql(DBHelper.Add(TableName, _modelFMD030));
                        ComForm.DspMsg("M002", "");
                        txtGYSMC.Focus();
                    }
                }
                catch (Exception ew)
                {
                    ComForm.DspMsg("E001", "");
                    ComForm.InsertErrLog(ew.ToString(), this.Name);
                    return;
                }
                Init();
            }
        }
コード例 #6
0
        //保存按钮
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (cboGlMc.Text.strReplace().IsNullOrEmpty())
            {
                ComForm.DspMsg("W002", "管理名称");
                cboGlMc.Focus();
                return;
            }
            if (txtMcKey.Text.strReplace().IsNullOrEmpty())
            {
                ComForm.DspMsg("W002", "名称KEY");
                txtMcKey.Focus();
                return;
            }
            if (txtZsMc.Text.strReplace().IsNullOrEmpty())
            {
                ComForm.DspMsg("W002", "正式名称");
                txtZsMc.Focus();
                return;
            }

            if (ComConst.LING == ComForm.DspMsg("Q004", ""))
            {
                try
                {
                    List <string> lisSql = new List <string>();
                    _modelFMD000.GLBH = cboGlMc.getValue() + txtMcKey.Text.strReplace();
                    _modelFMD000.ZSMC = txtZsMc.Text.strReplace();
                    _modelFMD000.SLMC = txtSxMc.Text.strReplace();
                    if (_bllFMD000.Exists(_modelFMD000.GLBH))
                    {
                        lisSql.Add(DBHelper.Del(TableName, "and GLBH='" + _modelFMD000.GLBH + "'"));
                    }
                    //插入数据
                    _modelFMD000.RLZBH = ComForm.strUserName;
                    _modelFMD000.RLR   = PublicFun.GetSystemDateTime(Const.Date, Const.dateStyle_YMD);
                    _modelFMD000.RLSJ  = PublicFun.GetSystemDateTime(Const.Time, string.Empty);
                    _modelFMD000.RLDMM = systemdate.Get_SysDNBH();
                    lisSql.Add(DBHelper.Add(TableName, _modelFMD000));
                    if (DbHelperMySql.ExecuteSqlTran(lisSql) != -1)
                    {
                        ComForm.DspMsg("M002", "");
                    }
                    else
                    {
                        ComForm.DspMsg("E001", "");
                        ComForm.InsertErrLog("数据插入失败!", this.Name);
                    }
                    cboGlMc.Focus();
                }
                catch (Exception ew)
                {
                    ComForm.DspMsg("E001", "");
                    ComForm.InsertErrLog(ew.ToString(), this.Name);
                    return;
                }
                txtMcKey.Text = string.Empty;
                txtZsMc.Text  = string.Empty;
                txtSxMc.Text  = string.Empty;
                fillSPD();
            }
        }