Exemplo n.º 1
0
        //添加
        public static object add(Gonggao gonggao)
        {
            sqltext = "insert into Gongggao(uid,title,detail,time)values('" + gonggao.Uid + "','" + gonggao.Title + "','" + gonggao.Detail + "','" + gonggao.Datetime + "')";
            int i = (int)DAL.SQLHELPER.ExecuteNonQuery(sqltext);

            return(i);
        }
Exemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     //  this.timer1.Start();
     if (txtContent.Text == "" || txtTitle.Text == "")
     {
         MessageBox.Show("没有填写完整");
     }
     else
     {
         if (MessageBox.Show("确定发布", "确定发布", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
         {
             if (this.checkBox1.Checked == true)       //启用推送
             {
                 this.skinProgressBar1.Visible = true; //显示进度条
                 this.timer1.Start();                  //开始进度条
             }
             else                                      //直接插入数据库
             {
                 Gonggao gg = new Gonggao();
                 gg.Title    = txtTitle.Text;
                 gg.Detail   = txtContent.Text;
                 gg.Uid      = Local.getCurrentUid();
                 gg.Datetime = DateTime.Now.ToLocalTime().ToString();
                 BLL.gonggaoBLL.add(gg);
                 MessageBox.Show("公告发布成功!");
                 this.Close();
             }
         }
     }
 }
Exemplo n.º 3
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     this.skinProgressBar1.PerformStep();    //按照设置的Step进行一步一步增加
     if (this.skinProgressBar1.Value >= 100) //进度条跑满
     {
         Gonggao gg = new Gonggao();
         gg.Title    = txtTitle.Text;
         gg.Detail   = txtContent.Text;
         gg.Uid      = Local.getCurrentUid();
         gg.Datetime = DateTime.Now.ToLocalTime().ToString();
         BLL.gonggaoBLL.add(gg);
         this.timer1.Stop();                            //关闭定时器
         Local.getClientInstance().sendData(gg.Detail); //发送到服务器
         MessageBox.Show("公告发布,并推送到所有客户端!");
         this.Close();
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// 增加公告
 /// </summary>
 /// <param name="gg"></param>
 /// <returns></returns>
 public static int add(Gonggao gg)
 {
     return(Convert.ToInt32(DAL.gonggaoServer.add(gg)));
 }