Beispiel #1
0
 public static DeptQuery GetInstance()
 {
     if (dqform == null || dqform.IsDisposed)
     {
         dqform = new DeptQuery();
     }
     return(dqform);
 }
Beispiel #2
0
        private void barButtonItem查询_ItemClick(object sender, ItemClickEventArgs e)
        {
            DeptQuery Frm = DeptQuery.GetInstance();

            Frm.TopLevel = false;
            Frm.Parent   = this;
            Frm.Show();
            Frm.BringToFront();
            //Children.Add(Frm);
        }
Beispiel #3
0
        private void Dept_Load(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Maximized;
            DeptQuery Frm = DeptQuery.GetInstance();

            Frm.TopLevel = false;
            Frm.Parent   = this;
            Frm.Show();
            Frm.BringToFront();
            Frm.Height = this.Height - 20;
            //xtraTabControl1.MakePageVisible(xtraTabPage1);
            //isno = true;
            //Children.Add(Frm);
        }
Beispiel #4
0
        private void barButtonItem修改_ItemClick(object sender, ItemClickEventArgs e)
        {
            string cname        = "";
            int    cid          = 0;
            int    saletypeid   = 0;
            string saletypename = "";

            DeptQuery.GetInfo(ref cid, ref cname, ref saletypeid, ref saletypename);
            if (cname != "")
            {
                DeptUpdate Frm = new DeptUpdate();
                Frm.TopLevel = false;
                Frm.Parent   = this;
                Frm.Show();
                Frm.BringToFront();
            }
        }
Beispiel #5
0
        private void DeptUpdate_Load(object sender, EventArgs e)
        {
            //this.WindowState = FormWindowState.Maximized;
            string cname = "", saletypename = "";
            int    id = 0, saletypeid = 0;
            ConnDB conn = new ConnDB();

            DeptQuery.GetInfo(ref id, ref cname, ref saletypeid, ref saletypename);
            string sql  = "select * from cost_saletype where cid = " + saletypeid + " and isnull(forbidden,'false') = 'true'";
            int    rows = conn.ReturnRecordCount(sql);

            Common.BasicDataBind("cost_saletype", comboBoxSaleType);
            if (cname != "")
            {
                textEditName.Text = cname;
                if (rows == 0)
                {
                    comboBoxSaleType.SelectedIndex = -1;
                    comboBoxSaleType.SelectedValue = saletypeid;
                }
                textEditID.Text         = id.ToString();
                textEditSaleTypeID.Text = saletypeid.ToString();
            }
        }
Beispiel #6
0
        private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            ConnDB conn = new ConnDB();
            string sql  = "update cost_dept set cname = '" + textEditName.Text.ToString().Trim() + "',saletype_id =" + comboBoxSaleType.SelectedValue.ToString();

            sql = sql + " where cid = " + textEditID.Text.ToString();
            string sql2 = "select cname from cost_dept where cname = '" + textEditName.Text.ToString() + "' and saletype_id = " + comboBoxSaleType.SelectedValue.ToString();

            if (textEditName.Text.ToString().Trim() != "" && comboBoxSaleType.SelectedValue.ToString() != "0")
            {
                int rows = conn.ReturnRecordCount(sql2);
                if (rows > 0)
                {
                    MessageBox.Show("该部门已经存在!");
                }
                else
                {
                    bool isok = conn.EditDatabase(sql);
                    if (isok)
                    {
                        MessageBox.Show("修改成功!");
                        DeptQuery.RefreshEX();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("失败!");
                    }
                }
            }
            else
            {
                MessageBox.Show("不能为空值!");
            }
            conn.Close();
        }
Beispiel #7
0
        private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            ConnDB conn = new ConnDB();
            string strsql, strsql2;
            int    rows;

            strsql  = "insert into cost_dept(CNAME,SALETYPE_ID) values('" + textEditName.Text.ToString().Trim() + "'," + comboBoxSaleType.SelectedValue.ToString() + ")";
            strsql2 = "select cname from cost_dept where cname = '" + textEditName.Text.ToString().Trim() + "'";
            if (textEditName.Text.ToString().Trim() != "")
            {
                rows = conn.ReturnRecordCount(strsql2);
                if (rows > 0)
                {
                    MessageBox.Show("该部门已经存在!");
                }
                else
                {
                    bool isok = conn.EditDatabase(strsql);
                    if (isok)
                    {
                        MessageBox.Show("添加成功!");
                        DeptQuery.RefreshEX();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("失败!");
                    }
                }
            }
            else
            {
                MessageBox.Show("名称不能为空!");
            }
            conn.Close();
        }
Beispiel #8
0
 private void barButtonItem反禁用_ItemClick(object sender, ItemClickEventArgs e)
 {
     DeptQuery.cEnable();
     DeptQuery.RefreshEX();
 }
Beispiel #9
0
 private void barButtonItem刷新_ItemClick(object sender, ItemClickEventArgs e)
 {
     DeptQuery.RefreshEX();
 }