Пример #1
0
        private void ToolStripDelete_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < gridView1.SelectedRowsCount; i++)
            {
                if (gridView1.GetSelectedRows()[i] >= 0)
                {
                    int    slrow = gridView1.GetSelectedRows()[i];
                    string uname = gridView1.GetRowCellValue(slrow, gridView1.Columns["Employee_LoginID"]).ToString();
                    IDGD = int.Parse(gridView1.GetRowCellValue(slrow, gridView1.Columns["Employee_id"]).ToString());
                    DataConfig clsget = new DataConfig();
                    DataTable  _mdt   = clsget.getTable("GET_ALLEMPLOYEE_DETAIL '" + uname.ToString() + "'");
                    if (_mdt != null && _mdt.Rows.Count > 0)
                    {
                        DialogResult result = MessageBox.Show("削除してもよろしいですか?", "確認", MessageBoxButtons.YesNo);

                        if (result == DialogResult.Yes)
                        {
                            DataConfig clins = new DataConfig();
                            string     SQL   = "exec SP_DELETE_USERS " + IDGD.ToString() + ",'" + uname + "'";
                            clins.Excute(SQL);
                            Clear();
                            btnSave.Enabled = false;
                            btnDel.Enabled  = false;
                            GENUSERS();
                            IDGD = 0;
                            MessageBox.Show("削除しました。");
                        }
                    }
                }
            }
        }
Пример #2
0
        private void ToolStripDelete_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < gridView1.SelectedRowsCount; i++)
            {
                if (gridView1.GetSelectedRows()[i] >= 0)
                {
                    int slrow = gridView1.GetSelectedRows()[i];
                    IDGD = int.Parse(gridView1.GetRowCellValue(slrow, gridView1.Columns["ID"]).ToString());
                    DataConfig clsget = new DataConfig();
                    DataTable  _mdt   = clsget.getTable("select * from [BUMON] where id='" + IDGD.ToString() + "'");
                    if (_mdt != null && _mdt.Rows.Count > 0)
                    {
                        DialogResult result = MessageBox.Show("削除してもよろしいですか?", "確認", MessageBoxButtons.YesNo);

                        if (result == DialogResult.Yes)
                        {
                            DataConfig clins = new DataConfig();
                            string     SQL   = "exec SP_DELETE_BUMON " + IDGD.ToString();
                            clins.Excute(SQL);

                            Clear();
                            btnSave.Enabled = false;
                            btnDel.Enabled  = false;
                            GENBUMON();
                            IDGD = 0;
                            MessageBox.Show("削除しました");
                        }
                    }
                }
            }
        }
Пример #3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            foreach (Control c in groupControl2.Controls)
            {
                if (c.GetType() == typeof(TextBox) && c.Text == "")
                {
                    if (c.Name.IndexOf("txtID") == -1)
                    {
                        MessageBox.Show("すべての情報を入力してください");
                        c.Focus();
                        return;
                    }
                }
            }
            string StoreName = "", strconfirm = "";

            if (IsNew == 1)
            {
                StoreName  = "SP_INSERT_KEIRO";
                strconfirm = "追加してよろしいでしょうか?";
                DataConfig CLSCHECK = new DataConfig();
                if (CLSCHECK.getTable("select * from KEIRO where Arrival=N'" + txtArival.Text + "' and Departure=N'" + txtDeparture.Text + "' and Transportation=N'" + txttransport.Text + "'").Rows.Count > 0)
                {
                    MessageBox.Show("入力した内容が重複しています。");
                    return;
                }
            }
            else if (isUpdate == 1)
            {
                StoreName  = "SP_UPDATE_KEIRO";
                strconfirm = "更新してよろしいでしょうか?";
            }
            //    #region
            DialogResult result = MessageBox.Show(strconfirm, "確認", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                DataConfig clins = new DataConfig();
                string     SQL   = "exec " + StoreName + " " + IDGD.ToString() + ",N'" + txtArival.Text.ToString() + "',N'" + txtDeparture.Text + "',N'" + txttransport.Text + "'," + decimal.Parse(txtFare.Text).ToString();
                clins.Excute(SQL);

                Clear();
                btnSave.Enabled = false;
                btnDel.Enabled  = false;
                GENKEIRO();
                IDGD = 0;
                MessageBox.Show("追加しました。");
            }
        }
Пример #4
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("削除してもよろしいですか?", "確認", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                DataConfig clins = new DataConfig();
                string     SQL   = "exec SP_DELETE_BUMON " + IDGD.ToString();
                clins.Excute(SQL);

                Clear();
                btnSave.Enabled = false;
                btnDel.Enabled  = false;
                GENBUMON();
                IDGD = 0;
                MessageBox.Show("削除しました");
            }
        }
Пример #5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            foreach (Control c in groupControl2.Controls)
            {
                if (c.GetType() == typeof(TextBox) && c.Text == "")
                {
                    if (c.Name.IndexOf("txtID") == -1)
                    {
                        MessageBox.Show("すべての情報を入力してください!");
                        c.Focus();
                        return;
                    }
                }
            }
            string StoreName = "", strconfirm = "";

            if (IsNew == 1)
            {
                StoreName  = "SP_INSERT_BUMON";
                strconfirm = "追加してよろしいでしょうか?";
            }
            else if (isUpdate == 1)
            {
                StoreName  = "SP_UPDATE_BUMON";
                strconfirm = "更新してよろしいでしょうか?";
            }
            //    #region
            DialogResult result = MessageBox.Show(strconfirm, "確認", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                DataConfig clins = new DataConfig();
                string     SQL   = "exec " + StoreName + " " + IDGD.ToString() + ",N'" + txtProjectcode.Text.ToString() + "',N'" + txtNote.Text + "'";
                clins.Excute(SQL);

                Clear();
                btnSave.Enabled = false;
                btnDel.Enabled  = false;
                GENBUMON();
                IDGD = 0;
                MessageBox.Show("追加しました。");
            }
        }
Пример #6
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            string StoreName = "", strconfirm = "";

            if (IsNew == 1)
            {
                StoreName  = "SP_INSERT_USERS";
                strconfirm = "追加してよろしいでしょうか?";
            }
            else if (isUpdate == 1)
            {
                StoreName  = "SP_UPDATE_USERS";
                strconfirm = "更新してよろしいでしょうか?";
            }
            //    #region
            DialogResult result = MessageBox.Show(strconfirm, "確認", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                DataConfig clins = new DataConfig();
                int        isad  = 0;
                if (chkIsadmin.Checked == true)
                {
                    isad = 1;
                }
                if (cmbbumon.SelectedIndex == -1)
                {
                    cmbbumon.SelectedIndex = 0;
                }
                GlobalVariables.Item it = (GlobalVariables.Item)cmbbumon.SelectedItem;

                string SQL = "exec " + StoreName + " " + IDGD.ToString() + ",N'" + txtName.Text.ToString() + "',N'" + txtUser.Text + "',N'" + txtPass.Text + "',N'" + txtSiteName.Text + "'," + it.Value + "," + isad + "";
                clins.Excute(SQL);

                Clear();
                btnSave.Enabled = false;
                btnDel.Enabled  = false;
                GENUSERS();
                IDGD = 0;
                MessageBox.Show("追加しました。");
            }
        }
Пример #7
0
        private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            for (int i = 0; i < gridView1.SelectedRowsCount; i++)
            {
                if (gridView1.GetSelectedRows()[i] >= 0)
                {
                    int slrow = gridView1.GetSelectedRows()[i];
                    IDGD = int.Parse(gridView1.GetRowCellValue(slrow, gridView1.Columns["ID"]).ToString());
                    DataConfig clsget = new DataConfig();
                    DataTable  _mdt   = clsget.getTable("select * from [BUMON] where id='" + IDGD.ToString() + "'");
                    if (_mdt != null && _mdt.Rows.Count > 0)
                    {
                        txtID.Text          = _mdt.Rows[0]["id"].ToString();
                        txtProjectcode.Text = _mdt.Rows[0]["Bumon_Name"].ToString();
                        txtNote.Text        = _mdt.Rows[0]["Bumon_Desc"].ToString();


                        btnDel.Enabled  = true;
                        btnSave.Enabled = true;
                        IsNew           = 0; isUpdate = 1;
                        disablecontrol(true);
                    }
                }
            }
        }
Пример #8
0
        private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            for (int i = 0; i < gridView1.SelectedRowsCount; i++)
            {
                if (gridView1.GetSelectedRows()[i] >= 0)
                {
                    int slrow = gridView1.GetSelectedRows()[i];
                    IDGD = int.Parse(gridView1.GetRowCellValue(slrow, gridView1.Columns["Keiro_id"]).ToString());
                    DataConfig clsget = new DataConfig();
                    DataTable  _mdt   = clsget.getTable("select * from [KEIRO] where Keiro_id='" + IDGD.ToString() + "'");
                    if (_mdt != null && _mdt.Rows.Count > 0)
                    {
                        txtID.Text        = _mdt.Rows[0]["Keiro_id"].ToString();
                        txtArival.Text    = _mdt.Rows[0]["Arrival"].ToString();
                        txtDeparture.Text = _mdt.Rows[0]["Departure"].ToString();
                        txttransport.Text = _mdt.Rows[0]["transportation"].ToString();

                        try
                        {
                            txtFare.Text = decimal.Parse(_mdt.Rows[0]["fare"].ToString()).ToString("#,##0");
                        }
                        catch { txtFare.Text = "0"; }

                        btnDel.Enabled  = true;
                        btnSave.Enabled = true;
                        IsNew           = 0; isUpdate = 1;
                        disablecontrol(true);
                    }
                }
            }
        }
Пример #9
0
        private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            for (int i = 0; i < gridView1.SelectedRowsCount; i++)
            {
                if (gridView1.GetSelectedRows()[i] >= 0)
                {
                    //gridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.Blue;
                    //gridView1.EnableHeadersVisualStyles = false;

                    int slrow = gridView1.GetSelectedRows()[i];
                    IDGD = int.Parse(gridView1.GetRowCellValue(slrow, gridView1.Columns["ID"]).ToString());
                    DataConfig clsget = new DataConfig();
                    DataTable  _mdt   = clsget.getTable("select * from [customer] where id='" + IDGD.ToString() + "'");
                    if (_mdt != null && _mdt.Rows.Count > 0)
                    {
                        txtID.Text      = _mdt.Rows[0]["id"].ToString();
                        txtCodecus.Text = _mdt.Rows[0]["customer_code"].ToString();
                        txtName.Text    = _mdt.Rows[0]["Customer_Name"].ToString();
                        //   txtTel.Text = _mdt.Rows[0]["Tel"].ToString();
                        //    txtAddress.Text = _mdt.Rows[0]["Address"].ToString();
                        txtNote.Text    = _mdt.Rows[0]["Description"].ToString();
                        btnDel.Enabled  = true;
                        btnSave.Enabled = true;
                        IsNew           = 0; isUpdate = 1;
                        disablecontrol(true);
                    }
                }
            }
        }