예제 #1
0
        private void btnThem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            frmExportUpdate frm = new frmExportUpdate(this.IDEmployee);

            frm.ShowDialog();
            gcData.DataSource = ex.loaddata();
        }
예제 #2
0
        private void btnSua_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int row_index = gvData.FocusedRowHandle;

            if (row_index < 0)
            {
                XtraMessageBox.Show("Vui lòng chọn dòng dữ liệu", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                string col_IDDocument  = "IDDocument";
                string col_CoTK        = "CoTK";
                string col_NoTK        = "NoTK";
                string col_Date        = "Date";
                string col_ToStore     = "ToStore";
                string col_FromStore   = "FromStore";
                string col_Description = "Description";
                string col_Bophan      = "PartReceived";
                string col_Nguoinhan   = "PersonReceived";

                //Update 11/12
                string col_SoHopDong = "SoHopDong";
                string col_SoHoaDon  = "SoHoaDon";

                string cotk, notk, des, bophan, nguoinhan;

                object value_IDDocument  = gvData.GetRowCellValue(row_index, col_IDDocument);
                object value_CoTK        = gvData.GetRowCellValue(row_index, col_CoTK);
                object value_NoTK        = gvData.GetRowCellValue(row_index, col_NoTK);
                object value_Date        = gvData.GetRowCellValue(row_index, col_Date);
                object value_ToStore     = gvData.GetRowCellValue(row_index, col_ToStore);
                object value_FromStore   = gvData.GetRowCellValue(row_index, col_FromStore);
                object value_Description = gvData.GetRowCellValue(row_index, col_Description);
                object value_Bophan      = gvData.GetRowCellValue(row_index, col_Bophan);
                object value_Nguoinhan   = gvData.GetRowCellValue(row_index, col_Nguoinhan);
                //Update 11/12
                object value_SoHopDong = gvData.GetRowCellValue(row_index, col_SoHopDong);
                object value_SoHoaDon  = gvData.GetRowCellValue(row_index, col_SoHoaDon);
                if (value_CoTK == null)
                {
                    cotk = "";
                }
                else
                {
                    cotk = value_CoTK.ToString();
                }
                if (value_NoTK == null)
                {
                    notk = "";
                }
                else
                {
                    notk = value_NoTK.ToString();
                }
                if (value_Description == null)
                {
                    des = "";
                }
                else
                {
                    des = value_Description.ToString();
                }
                if (value_Bophan == null)
                {
                    bophan = "";
                }
                else
                {
                    bophan = value_Bophan.ToString();
                }
                if (value_Nguoinhan == null)
                {
                    nguoinhan = "";
                }
                else
                {
                    nguoinhan = value_Nguoinhan.ToString();
                }
                frmExportUpdate frm = new frmExportUpdate(
                    IDEmployee,
                    Convert.ToInt32(value_IDDocument.ToString()),
                    notk,
                    cotk,
                    Convert.ToDateTime(value_Date),
                    value_FromStore.ToString(),
                    value_ToStore.ToString(),
                    des,
                    bophan,
                    nguoinhan,
                    value_SoHopDong == null ? "" : value_SoHopDong.ToString(),
                    value_SoHoaDon == null ? "" : value_SoHoaDon.ToString());
                frm.ShowDialog();
                gcData.DataSource = ex.loaddata();
            }
        }