Ejemplo n.º 1
0
        private void btn_saveimgpath_Click(object sender, EventArgs e)
        {
            if (tb_choosedimgpath.Text == null || tb_choosedimgpath.Text.Trim().Length == 0)
            {
                MessageBox.Show("请先选择证据图片保存路径!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            string sql = "UPDATE systemset SET EvidenceImgSavePath=@EvidenceImgSavePath WHERE id=1";
            List <MySqlParameter> pars = new List <MySqlParameter>();

            pars.Add(new MySqlParameter("@EvidenceImgSavePath", tb_choosedimgpath.Text));
            try
            {
                DataBaseServer.MySqlCmd dbobj = new DataBaseServer.MySqlCmd();
                if (dbobj.ExecuteNonQueryInt(sql, pars) > 0)
                {
                    SystemSet ss = (SystemSet)GlobalPars.GloPars["systemset"];
                    ss.EvidenceImgSavePath = tb_choosedimgpath.Text;
                    MessageBox.Show("修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("修改失败,请稍后重试!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("出现异常,请稍后重试或联系软件提供商!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 修改用户
        /// </summary>
        /// <param name="obj">用户对象</param>
        /// <returns></returns>
        public int FixReleaseInfo(ModelReleaseInfo obj)
        {
            string sql = @"UPDATE SET ReleaseInfo Title=@Title,Contexts=@Contexts,ReleaseDate=@ReleaseDate,
                                InfoSource=@InfoSource,KeyWords=@KeyWords,ReleaseName=@ReleaseName,
                                CollectDate=@CollectDate,Snapshot=@Snapshot  
                        WHERE uid=@uid";

            List <MySqlParameter> par = new List <MySqlParameter>();

            par.Add(new MySqlParameter("@uid", obj.Uid));
            par.Add(new MySqlParameter("@Title", obj.Title));
            par.Add(new MySqlParameter("@Contexts", obj.Contexts));
            par.Add(new MySqlParameter("@RleaseDate", obj.ReleaseDate));
            par.Add(new MySqlParameter("@InfoSource", obj.InfoSource));
            par.Add(new MySqlParameter("@KeyWords", obj.KeyWords));
            par.Add(new MySqlParameter("@ReleaseName", obj.ReleaseName));
            par.Add(new MySqlParameter("@CollectDate", obj.CollectDate));
            par.Add(new MySqlParameter("@Snapshot", obj.Snapshot));

            try
            {
                DataBaseServer.MySqlCmd dbobj = new DataBaseServer.MySqlCmd();
                return(dbobj.ExecuteNonQueryInt(sql, par));
            }
            catch (Exception ex)
            {
                throw new Exception("新建失败,位置:FixReleaseInfo.原因:" + ex.Message);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 修改用户
        /// </summary>
        /// <param name="obj">用户对象</param>
        /// <returns></returns>
        public int FixReleaseInfo(ModelReleaseInfo obj)
        {
            string sql = @"UPDATE SET ReleaseInfo Title=@Title,Contexts=@Contexts,ReleaseDate=@ReleaseDate,
                                InfoSource=@InfoSource,KeyWords=@KeyWords,ReleaseName=@ReleaseName,
                                CollectDate=@CollectDate,Snapshot=@Snapshot
                        WHERE uid=@uid";

            List<MySqlParameter> par = new List<MySqlParameter>();
            par.Add(new MySqlParameter("@uid", obj.Uid));
            par.Add(new MySqlParameter("@Title", obj.Title));
            par.Add(new MySqlParameter("@Contexts", obj.Contexts));
            par.Add(new MySqlParameter("@RleaseDate", obj.ReleaseDate));
            par.Add(new MySqlParameter("@InfoSource", obj.InfoSource));
            par.Add(new MySqlParameter("@KeyWords", obj.KeyWords));
            par.Add(new MySqlParameter("@ReleaseName", obj.ReleaseName));
            par.Add(new MySqlParameter("@CollectDate", obj.CollectDate));
            par.Add(new MySqlParameter("@Snapshot", obj.Snapshot));

            try
            {
                DataBaseServer.MySqlCmd dbobj = new DataBaseServer.MySqlCmd();
                return dbobj.ExecuteNonQueryInt(sql, par);
            }
            catch (Exception ex)
            {
                throw new Exception("新建失败,位置:FixReleaseInfo.原因:" + ex.Message);
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 删除用户信息
 /// </summary>
 /// <param name="uid">用户ID</param>
 /// <returns>返回值,1为成功</returns>
 public int DelReleaseInfo(int uid)
 {
     string sql = @"DELETE FROM ReleaseInfo WHERE uid=@uid";
     List<MySqlParameter> par = new List<MySqlParameter>();
     par.Add(new MySqlParameter("@uid", uid));
     try
     {
         DataBaseServer.MySqlCmd dbobj = new MySqlCmd();
         return dbobj.ExecuteNonQueryInt(sql, par);
     }
     catch (Exception ex)
     {
         throw new Exception("删除失败,位置:DelReleaseInfo.原因:" + ex.Message);
     }
 }
Ejemplo n.º 5
0
        private void btn_updatepwd_Click(object sender, EventArgs e)
        {
            UserInfo ui = (UserInfo)GlobalPars.GloPars["UserInfo"];

            if (ui.Pword != tb_oldpwd.Text)
            {
                MessageBox.Show("您输入的旧密码不正确!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            string newpwd1 = tb_newpwd1.Text;
            string newpwd2 = tb_newpwd2.Text;

            if (!newpwd1.Equals(newpwd2))
            {
                MessageBox.Show("您两次输入的密码不一致!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            string sql = "UPDATE LoginUser SET PWord=@PWord WHERE uid=@Uid";
            List <MySqlParameter> pars = new List <MySqlParameter>();

            pars.Add(new MySqlParameter("@PWord", newpwd1));
            pars.Add(new MySqlParameter("@Uid", ui.Uid));
            try
            {
                DataBaseServer.MySqlCmd dbobj = new DataBaseServer.MySqlCmd();
                if (dbobj.ExecuteNonQueryInt(sql, pars) > 0)
                {
                    MessageBox.Show("修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    ui.Pword = newpwd1;
                }
                else
                {
                    MessageBox.Show("修改失败,请稍后重试或联系软件提供商!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("修改失败,请稍后重试或联系软件提供商!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 6
0
 private void btn_updatepwd_Click(object sender, EventArgs e)
 {
     UserInfo ui = (UserInfo)GlobalPars.GloPars["UserInfo"];
     if (ui.Pword != tb_oldpwd.Text)
     {
         MessageBox.Show("您输入的旧密码不正确!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     string newpwd1 = tb_newpwd1.Text;
     string newpwd2 = tb_newpwd2.Text;
     if (!newpwd1.Equals(newpwd2))
     {
         MessageBox.Show("您两次输入的密码不一致!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     string sql = "UPDATE LoginUser SET PWord=@PWord WHERE uid=@Uid";
     List<MySqlParameter> pars = new List<MySqlParameter>();
     pars.Add(new MySqlParameter("@PWord", newpwd1));
     pars.Add(new MySqlParameter("@Uid", ui.Uid));
     try
     {
         DataBaseServer.MySqlCmd dbobj = new DataBaseServer.MySqlCmd();
         if (dbobj.ExecuteNonQueryInt(sql, pars) > 0)
         {
             MessageBox.Show("修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             ui.Pword = newpwd1;
         }
         else
         {
             MessageBox.Show("修改失败,请稍后重试或联系软件提供商!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("修改失败,请稍后重试或联系软件提供商!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 7
0
 private void btn_saveimgpath_Click(object sender, EventArgs e)
 {
     if (tb_choosedimgpath.Text == null || tb_choosedimgpath.Text.Trim().Length == 0)
     {
         MessageBox.Show("请先选择证据图片保存路径!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     string sql = "UPDATE systemset SET EvidenceImgSavePath=@EvidenceImgSavePath WHERE id=1";
     List<MySqlParameter> pars = new List<MySqlParameter>();
     pars.Add(new MySqlParameter("@EvidenceImgSavePath", tb_choosedimgpath.Text));
     try
     {
         DataBaseServer.MySqlCmd dbobj = new DataBaseServer.MySqlCmd();
         if (dbobj.ExecuteNonQueryInt(sql, pars) > 0)
         {
             SystemSet ss = (SystemSet)GlobalPars.GloPars["systemset"];
             ss.EvidenceImgSavePath = tb_choosedimgpath.Text;
             MessageBox.Show("修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             MessageBox.Show("修改失败,请稍后重试!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("出现异常,请稍后重试或联系软件提供商!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 8
0
        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="obj">用户对象</param>
        /// <returns></returns>
        public int InsReleaseInfo(ModelReleaseInfo obj)
        {
            string sql = @"INSERT INTO ReleaseInfo(Title,Contexts,ReleaseDate,InfoSource,KeyWords,ReleaseName,CollectDate,Snapshot)
                            VALUES(@Title,@Contexts,@RleaseDate,@InfoSource,@KeyWords,@ReleaseName,@CollectDate,@Snapshot) ";

            List<MySqlParameter> par = new List<MySqlParameter>();
            par.Add(new MySqlParameter("@Title", obj.Title));
            par.Add(new MySqlParameter("@Contexts", obj.Contexts));
            par.Add(new MySqlParameter("@RleaseDate", obj.ReleaseDate));
            par.Add(new MySqlParameter("@InfoSource", obj.InfoSource));
            par.Add(new MySqlParameter("@KeyWords", obj.KeyWords));
            par.Add(new MySqlParameter("@ReleaseName", obj.ReleaseName));
            par.Add(new MySqlParameter("@CollectDate", obj.CollectDate));
            par.Add(new MySqlParameter("@Snapshot", obj.Snapshot));

            try
            {
                MySqlCmd dbobj = new MySqlCmd();
                return dbobj.ExecuteNonQueryInt(sql, par);

            }
            catch (Exception ex)
            {
                throw new Exception("新建失败,位置:InsReleaseInfo.原因:" + ex.Message);
            }
        }