Пример #1
0
        private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            ConnDB conn = new ConnDB();
            string strsql, strsql2;
            int    rows;

            strsql  = "insert into cost_festival(festival_date,festival_type,festival_note) values('" + dateTimePickerDate.Text.ToString() + "','" + comboBoxType.SelectedValue.ToString() + "','" + textEditNote.Text.ToString().Trim() + "')";
            strsql2 = "select * from cost_festival where festival_date = '" + dateTimePickerDate.Text.ToString() + "'";
            if (textEditNote.Text.ToString().Trim() != "")
            {
                rows = conn.ReturnRecordCount(strsql2);
                if (rows > 0)
                {
                    MessageBox.Show("该日期已经存在!");
                }
                else
                {
                    bool isok = conn.EditDatabase(strsql);
                    if (isok)
                    {
                        MessageBox.Show("添加成功!");
                        FestivalQuery.RefreshEX();
                        this.Close();
                    }
                }
            }
            else
            {
                MessageBox.Show("不能为空!");
            }
            conn.Close();
        }
Пример #2
0
        private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            ConnDB conn = new ConnDB();
            string sql  = "update cost_festival set festival_date = '" + dateEditDate.Text + "',festival_type = '" + comboBoxType.SelectedValue.ToString() + "',festival_note = '" + textEditNote.Text.ToString().Trim() + "' where festival_date ='" + cdate + "'";
            string sql2 = "select * from cost_festival where festival_date = '" + dateEditDate.Text + "'";

            if (textEditNote.Text.ToString().Trim() != "")
            {
                int rows = conn.ReturnRecordCount(sql2);
                if (rows > 0 && dateEditDate.Text != cdate)
                {
                    MessageBox.Show("该日期已经存在!");
                }
                else
                {
                    bool isok = conn.EditDatabase(sql);
                    if (isok)
                    {
                        MessageBox.Show("修改成功!");
                        FestivalQuery.RefreshEX();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("失败!");
                    }
                }
            }
            else
            {
                MessageBox.Show("名称不能为空!");
            }
            conn.Close();
        }
Пример #3
0
        private void SaleTypeUpdate_Load(object sender, EventArgs e)
        {
            //this.WindowState = FormWindowState.Maximized;
            //绑定类型
            Dictionary <int, string> kvDictonary = new Dictionary <int, string>();

            kvDictonary.Add(0, "日常班");
            kvDictonary.Add(1, "周末");
            kvDictonary.Add(2, "节假日");

            BindingSource bs = new BindingSource();

            bs.DataSource              = kvDictonary;
            comboBoxType.DataSource    = bs;
            comboBoxType.ValueMember   = "Key";
            comboBoxType.DisplayMember = "Value";
            FestivalQuery.GetInfo(ref cdate, ref ctype, ref cnote);
            if (cdate != "")
            {
                textEditNote.Text          = cnote;
                dateEditDate.Text          = cdate;
                comboBoxType.SelectedIndex = -1;
                comboBoxType.SelectedValue = ctype;
            }

            //this.WindowState = FormWindowState.Maximized;
        }
Пример #4
0
 public static FestivalQuery GetInstance()
 {
     if (wtqform == null || wtqform.IsDisposed)
     {
         wtqform = new FestivalQuery();
     }
     return(wtqform);
 }
Пример #5
0
        private void barButtonItem查询_ItemClick(object sender, ItemClickEventArgs e)
        {
            FestivalQuery Frm = FestivalQuery.GetInstance();

            Frm.TopLevel = false;
            Frm.Parent   = this;
            Frm.Show();
            Frm.BringToFront();
        }
Пример #6
0
        private void SaleType_Load(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Maximized;
            FestivalQuery Frm = FestivalQuery.GetInstance();

            Frm.TopLevel = false;
            Frm.Parent   = this;
            Frm.Show();
            Frm.BringToFront();
            Frm.Height = this.Height - 20;
            //Frm.Width = this.Width - 15;
            //Frm.Height = this.Width - 60;
        }
Пример #7
0
        private void barButtonItem修改_ItemClick(object sender, ItemClickEventArgs e)
        {
            string cnote = "", cdate = "";
            int    ctype = 0;

            FestivalQuery.GetInfo(ref cdate, ref ctype, ref cnote);
            if (cdate != "")
            {
                //SaleTypeUpdate Frm = SaleTypeUpdate.GetInstance();
                FestivalUpdate Frm = new FestivalUpdate();
                Frm.TopLevel = false;
                Frm.Parent   = this;
                Frm.Show();
                Frm.BringToFront();
            }
        }
Пример #8
0
 private void barButtonItem刷新_ItemClick(object sender, ItemClickEventArgs e)
 {
     FestivalQuery.RefreshEX();
 }