コード例 #1
0
ファイル: frmOpticalSW.cs プロジェクト: tayeumi/HFC
        private void btnDel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int SelectedRow = gridItemDetail.FocusedRowHandle;

            if (SelectedRow >= 0)
            {
                DataRow drow   = gridItemDetail.GetDataRow(SelectedRow);
                int     _value = int.Parse(drow["ID"].ToString());

                if (Class.App.ConfirmDeletion() == DialogResult.No)
                {
                    return;
                }

                Class.NW_OpticalSW cls = new Class.NW_OpticalSW();
                cls.ID = _value;
                if (cls.Delete())
                {
                    Class.App.DeleteSuccessfully();
                    NW_OpticalSW_Getlist();
                }
                else
                {
                    Class.App.DeleteNotSuccessfully();
                }
            }
        }
コード例 #2
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     if (add)
     {
         Class.NW_OpticalSW cls = new Class.NW_OpticalSW();
         cls.Name      = txtName.Text;
         cls.IpAddress = txtIpAddress.Text;
         if (cls.Insert())
         {
             MessageBox.Show("Thêm thành công !");
             this.Close();
         }
         else
         {
             MessageBox.Show("Thêm thất bại !");
         }
     }
     else
     {
         Class.NW_OpticalSW cls = new Class.NW_OpticalSW();
         cls.ID        = id;
         cls.Name      = txtName.Text;
         cls.IpAddress = txtIpAddress.Text;
         if (cls.Update())
         {
             MessageBox.Show("Cập nhật thành công !");
             this.Close();
         }
         else
         {
             MessageBox.Show("Cập nhậtthất bại !");
         }
     }
 }
コード例 #3
0
        private void call_info(string Form_name, int code)
        {
            Class.NW_OpticalSW cls = new Class.NW_OpticalSW();
            cls.ID = code;
            DataTable dt = cls.NW_OpticalSW_Get();

            txtName.Text      = dt.Rows[0]["Name"].ToString();
            txtIpAddress.Text = dt.Rows[0]["IpAddress"].ToString();
        }
コード例 #4
0
ファイル: frmOpticalSW_Update.cs プロジェクト: tayeumi/HFC
        private void btnUpdateNew_Click(object sender, EventArgs e)
        {
            if (add)
            {
                Class.NW_OpticalSW cls = new Class.NW_OpticalSW();
                cls.Name = txtName.Text;
                cls.IpAddress = txtIpAddress.Text;
                if (cls.Insert())
                {
                    MessageBox.Show("Thêm thành công !");
                    txtName.Text = "";
                    txtIpAddress.Text = "";
                    add = true;
                }
                else
                {
                    MessageBox.Show("Thêm thất bại !");
                }

            }
            else
            {
                Class.NW_OpticalSW cls = new Class.NW_OpticalSW();
                cls.ID = id;
                cls.Name = txtName.Text;
                cls.IpAddress = txtIpAddress.Text;
                if (cls.Update())
                {
                    MessageBox.Show("Cập nhật thành công !");
                    txtIpAddress.Text = "";
                    txtName.Text = "";
                    add = true;
                }
                else
                {
                    MessageBox.Show("Cập nhậtthất bại !");
                }
            }
        }
コード例 #5
0
ファイル: frmOpticalSW.cs プロジェクト: tayeumi/HFC
        private void btnDel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int SelectedRow = gridItemDetail.FocusedRowHandle;
            if (SelectedRow >= 0)
            {
                DataRow drow = gridItemDetail.GetDataRow(SelectedRow);
                int _value = int.Parse(drow["ID"].ToString());

                if (Class.App.ConfirmDeletion() == DialogResult.No)
                    return;

                Class.NW_OpticalSW cls = new Class.NW_OpticalSW();
                cls.ID = _value;
                if (cls.Delete())
                {
                    Class.App.DeleteSuccessfully();
                    NW_OpticalSW_Getlist();
                }
                else
                {
                    Class.App.DeleteNotSuccessfully();
                }
            }
        }
コード例 #6
0
ファイル: frmOpticalSW.cs プロジェクト: tayeumi/HFC
 void NW_OpticalSW_Getlist()
 {
     Class.NW_OpticalSW cls = new Class.NW_OpticalSW();
     dt = cls.NW_OpticalSW_Getlist();
     gridItem.DataSource = dt;
 }
コード例 #7
0
ファイル: frmOpticalSW.cs プロジェクト: tayeumi/HFC
 void NW_OpticalSW_Getlist()
 {
     Class.NW_OpticalSW cls = new Class.NW_OpticalSW();
     dt = cls.NW_OpticalSW_Getlist();
     gridItem.DataSource = dt;
 }
コード例 #8
0
ファイル: frmOpticalSW_Update.cs プロジェクト: tayeumi/HFC
 private void call_info(string Form_name, int code)
 {
     Class.NW_OpticalSW cls = new Class.NW_OpticalSW();
     cls.ID = code;
     DataTable dt = cls.NW_OpticalSW_Get();
     txtName.Text = dt.Rows[0]["Name"].ToString();
     txtIpAddress.Text = dt.Rows[0]["IpAddress"].ToString();
 }