Beispiel #1
0
        private void btnDelRow_Click(object sender, EventArgs e)
        {
            List <SubjectDto> subjectList = new List <SubjectDto>();

            for (int i = 0; i < grvSubject.RowCount; i++)
            {
                object dd = grvSubject.GetRowCellValue(i, grvSubject.Columns[10]);
                if (dd != null)
                {
                    if (grvSubject.GetRowCellValue(i, grvSubject.Columns[10]).ToString() == "True")
                    {
                        subjectList.Add(grvSubject.GetRow(i) as SubjectDto);
                    }
                }
            }
            foreach (SubjectDto subject in subjectList)
            {
                DataSet dsInstand = webService.SearchInspectionStandardByProjectCodeAndSubjectCode(subject.ProjectCode, subject.SubjectCode);
                if (dsInstand.Tables[0].Rows.Count > 0)
                {
                    CommonHandler.ShowMessage(MessageType.Information, "请先删除检查标准");
                    return;
                }
                DataSet dsFile = webService.SearchFileAndPictureByProjectCodeAndSubjectCode(subject.ProjectCode, subject.SubjectCode);
                if (dsFile.Tables[0].Rows.Count > 0)
                {
                    CommonHandler.ShowMessage(MessageType.Information, "请先删除文件名称/拍照点");
                    return;
                }
            }
            dataHandlerSubject.DelCheckedRow(grvSubject.Columns.ColumnByFieldName("CheckMarkSelection"));
            selection.ClearSelection();
        }
Beispiel #2
0
        void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            if (radioGroup1.SelectedIndex == -1)
            {
                Common.setMessageBox("Select Mapping Option", Program.ApplicationName, 2);
                return;
            }
            else
            {
                selection.ClearSelection();

                GridView view = (GridView)gridControl1.FocusedView;

                if (view != null)
                {
                    DataRow dr = view.GetDataRow(view.FocusedRowHandle);
                    if (dr != null)
                    {
                        ID              = dr["CentreCode"].ToString();
                        stationcode     = dr["StationCode"].ToString();
                        cboCentre.Text  = dr["CentreName"].ToString();
                        cboStation.Text = dr["StationName"].ToString();

                        DataTable dts = (new Logic()).getSqlStatement((String.Format("SELECT RevenueCode FROM tblPrintingCenterMap where CentreCode ='{0}' and StationCode ='{1}'", ID, stationcode))).Tables[0];
                        if (dts != null)
                        {
                            BindData(dts);
                            boolIsUpdate = true;
                        }
                    }
                }
            }
        }
 private void btnDelRow_Click(object sender, EventArgs e)
 {
     if (CommonHandler.ShowMessage(MessageType.Confirm, "删除执行文件,与执行文件相关的数据都会删除,确定要进行吗?") == DialogResult.Yes)
     {
         dataHandlerSubject.DelCheckedRow(grvSubject.Columns.ColumnByFieldName("CheckMarkSelection"));
         selection.ClearSelection();
     }
 }
 private void btnDeleteRow_Click(object sender, EventArgs e)
 {
     dataHandler.DelCheckedRow(grvSaleContant.Columns.ColumnByFieldName("CheckMarkSelection"));
     selection.ClearSelection();
     foreach (SalesConsultantDto dto in dataHandler.DataList as List <SalesConsultantDto> )
     {
         if (dto.StatusType == 'D')
         {
             service.SaveSalesConsultant(CommonHandler.GetComboBoxSelectedValue(cboProject).ToString(), _shopCode, txtSubjectCode.Text.Trim(), Convert.ToString(dto.SeqNO),
                                         dto.SalesConsultant, "", "", _userId, dto.StatusType, _memberType);
         }
     }
 }
Beispiel #5
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     foreach (DataRowView _rowView in m_DeliveryNoteDetailMultiselect.Selection)
     {
         m_DeliveryNoteDetailData.Rows.Remove(_rowView.Row);
     }
     if (m_DeliveryNoteDetailData.Rows.Count == 0)
     {
         btnUpdate.Enabled = false;
         btnDelete.Enabled = false;
     }
     m_DeliveryNoteDetailMultiselect.ClearSelection();
 }
Beispiel #6
0
 private void grpListRoom_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e)
 {
     if (e.Button == grpListRoom.CustomHeaderButtons[0])
     {
         ArrayList rowViews = roomSelectsMulitiSelect.Selection;
         foreach (DataRowView rowView in rowViews)
         {
             DataRow row = rowView.Row;
             roomSelectsDataTable.Rows.Remove(row);
         }
         grdListRoom.DataSource = roomSelectsDataTable;
         roomSelectsMulitiSelect.ClearSelection();
     }
 }
Beispiel #7
0
        private void btnLinkDelRow_Click(object sender, EventArgs e)
        {
            List <LinkDto> subjectList = new List <LinkDto>();

            for (int i = 0; i < grvLink.RowCount; i++)
            {
                object dd = grvLink.GetRowCellValue(i, grvLink.Columns[6]);
                if (dd != null)
                {
                    if (grvLink.GetRowCellValue(i, grvLink.Columns[6]).ToString() == "True")
                    {
                        subjectList.Add(grvLink.GetRow(i) as LinkDto);
                    }
                }
            }
            foreach (LinkDto subject in subjectList)
            {
                DataSet dsInstand = webService.SearchSubject(CommonHandler.GetComboBoxSelectedValue(cboProject).ToString(), subject.CharterCode, subject.LinkCode, "");
                if (dsInstand.Tables[0].Rows.Count > 0)
                {
                    CommonHandler.ShowMessage(MessageType.Information, "请先删除执行体系");
                    return;
                }
            }
            dataHandlerLink.DelCheckedRow(grvLink.Columns.ColumnByFieldName("CheckMarkSelection"));
            selectionLink.ClearSelection();
        }
Beispiel #8
0
        private void SpbAdd_Click(object sender, EventArgs e)
        {
            if (selection.SelectedCount == 0)
            {
                Common.setMessageBox("No Selection Made to Merge", Program.ApplicationName, 3);
                return;
            }
            else
            {
                for (int i = 0; i < selection.SelectedCount; i++)
                {
                    temTable.Rows.Add(new object[] { String.Format("{0}", (selection.GetSelectedRow(i) as DataRowView)["UTIN"]), String.Format("{0}", (selection.GetSelectedRow(i) as DataRowView)["OrganizationName"]) });
                }

                if (temTable != null && temTable.Rows.Count > 0)
                {
                    gridControl2.DataSource = temTable;

                    gridView2.Columns["UTIN"].OptionsColumn.AllowEdit = false;

                    gridView2.Columns["OrganizationName"].OptionsColumn.AllowEdit = false;

                    gridView2.BestFitColumns();

                    selection.ClearSelection();
                }

                //_Helper = new GridRadioGroupColumnHelper(gridView2);
            }
        }
Beispiel #9
0
        void bttnUpdate_Click(object sender, EventArgs e)
        {
            if (selection.SelectedCount < 1)
            {
                Common.setMessageBox("Please, select record to Map", Program.ApplicationName, 3);
            }
            else if (cboStation.SelectedIndex < 0)
            {
                Common.setMessageBox("Please, select Station to Map", Program.ApplicationName, 3);
            }
            else
            {
                //return;
                using (SqlConnection db = new SqlConnection(Logic.ConnectionString))
                {
                    SqlTransaction transaction;
                    SqlCommand     sqlCommand1;

                    db.Open();

                    transaction = db.BeginTransaction();

                    try
                    {
                        for (int i = 0; i < selection.SelectedCount; i++)
                        {
                            //using (var ds = new System.Data.DataSet())
                            //{//select record
                            //BranchCode,BankShortCode

                            string lol  = ((selection.GetSelectedRow(i) as DataRowView)["BranchCode"].ToString());
                            string lol2 = ((selection.GetSelectedRow(i) as DataRowView)["BankShortCode"].ToString());

                            string query = String.Format("INSERT INTO [tblStationMap]([StationCode],[StationName],[RevenueOfficeCode],[RevenueOfficeName]) VALUES ('{0}','{1}','{2}','{3}')", cboStation.SelectedValue.ToString(), cboStation.Text, lol, lol2);


                            sqlCommand1 = new SqlCommand(query, db, transaction);
                            sqlCommand1.ExecuteNonQuery();
                        }


                        //call report for Print
                        transaction.Commit();
                        //ReceiptCall();
                    }
                    catch (SqlException sqlError)
                    {
                        transaction.Rollback();
                    }
                    db.Close();

                    setReload();

                    cboStation.SelectedIndex = -1;

                    Common.setMessageBox("Record has been successfully added", Program.ApplicationName, 1);
                    selection.ClearSelection();
                }
            }
        }
 private void btnDelete_Click(object sender, EventArgs e)
 {
     foreach (DataRowView _rowView in m_DeliveryNoteDetailMultiselect.Selection)
     {
         m_DeliveryNoteDetailData.Rows.Remove(_rowView.Row);
     }
     m_DeliveryNoteDetailMultiselect.ClearSelection();
 }
Beispiel #11
0
 public override void DeleteRowButtonClick()
 {
     if (CommonHandler.ShowMessage(MessageType.Confirm, "删除经销商时会把所有期相关的数据都删除,确定要进行吗?") == DialogResult.Yes)
     {
         dataHandler.DelCheckedRow(grvShop.Columns.ColumnByFieldName("CheckMarkSelection"));
         selection.ClearSelection();
     }
 }
Beispiel #12
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     foreach (DataRowView _rowView in serviceDetailMultiselect.Selection)
     {
         listServiceDetailObject.Remove(new DTOServiceDetail(_rowView.Row.ItemArray[2].ToString(), _rowView.Row.ItemArray[3].ToString(), Int32.Parse(_rowView.Row.ItemArray[4].ToString()), Int32.Parse(_rowView.Row.ItemArray[5].ToString())));
         serviceDetailDataTable.Rows.Remove(_rowView.Row);
     }
     serviceDetailMultiselect.ClearSelection();
 }
        public override void DeleteRowButtonClick()
        {
            dataHandler.DelCheckedRow(selection.CheckMarkColumn);

            if (grvUserInfo.DataRowCount == 0)
            {
                this.CSParentForm.EnabelButton(ButtonType.DeleteRowButton, false);
            }

            selection.ClearSelection();
        }
        private void btnDeleteRow_Click(object sender, EventArgs e)
        {
            dataHandler.DelCheckedRow(selection.CheckMarkColumn);

            if (grvScoreSet.DataRowCount == 0)
            {
                btnDeleteRow.Enabled = false;
            }

            selection.ClearSelection();
        }
Beispiel #15
0
        private void CargarSucursales()
        {
            CLS_Sucursales bsel = new CLS_Sucursales();

            bsel.ListarSucursales();
            if (bsel.Exito)
            {
                gridCheckMarkSucursales.ClearSelection(cboGridFloracionView);
                TotalRegSucursales = bsel.Datos.Rows.Count;
                cboGridSucursales.Properties.DataSource = bsel.Datos;
            }
        }
 private void btnDel_Click(object sender, EventArgs e)
 {
     if (tabControl.SelectedTab == tabPage1)
     {
         dataHandler1.DelCheckedRow(grvLossResult1.Columns.ColumnByFieldName("CheckMarkSelection"));
         selection1.ClearSelection();
     }
     else if (tabControl.SelectedTab == tabPage2)
     {
         dataHandler2.DelCheckedRow(grvLossResult2.Columns.ColumnByFieldName("CheckMarkSelection"));
         selection2.ClearSelection();
     }
     else
     {
         dataHandler3.DelCheckedRow(grvLossResult3.Columns.ColumnByFieldName("CheckMarkSelection"));
         selection3.ClearSelection();
     }
 }
Beispiel #17
0
        public override void DeleteButtonClick()
        {
            DialogResult reslut = CommonHandler.ShowMessage(MessageType.Confirm, "确定要删除选中的行吗?");

            if (reslut != DialogResult.Yes)
            {
                return;
            }
            dataHandler.DelCheckedRow(selection.CheckMarkColumn);
            selection.ClearSelection();

            foreach (NoticeDto item in dataHandler.DataList)
            {
                if (item.StatusType == 'D')
                {
                    webService.DeleteNotice(item.NoticeID);
                }
            }
            this.SearchButtonClick();
        }
        private void updateEnableButtonAndResetValueOfControl(ref SimpleButton _btnControl)
        {
            switch (_btnControl.Name)
            {
            case "btnAdd":
            {
                m_EmployeeMultiSelect.ClearSelection();
                //
                txtEmployeeId.Text = "NV00000**";
                btnAdd.Visible     = false;
                btnCancel.Visible  = true;
                //
                btnSave.Enabled   = true;
                btnUpdate.Enabled = false;
                btnDelete.Enabled = false;
                //
                txtEmployeeName.Properties.ReadOnly    = false;
                txtEmployeeAddress.Properties.ReadOnly = false;
                dateBirthDay.Properties.ReadOnly       = false;
                txtEmployeeEmail.Properties.ReadOnly   = false;
                cmbEmployeeGender.Properties.ReadOnly  = false;
                txtEmployeePhone.Properties.ReadOnly   = false;
                dateToWork.Properties.ReadOnly         = false;
                lkEmployeeCharge.Properties.ReadOnly   = false;
                //
                grdvListEmployee.OptionsSelection.EnableAppearanceFocusedRow           = false;
                grdvListEmployee.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = false;
                //
                txtEmployeeName.EditValue    = null;
                txtEmployeeAddress.EditValue = null;
                dateBirthDay.EditValue       = null;
                txtEmployeeEmail.EditValue   = null;
                cmbEmployeeGender.EditValue  = null;
                txtEmployeePhone.EditValue   = null;
                //
                m_IsAdd = true;
                break;
            }

            case "btnCancel":
            {
                m_IsAdd = false;
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                btnUpdate.Visible         = true;
                //
                btnUpdate.Enabled = true;
                btnDelete.Enabled = true;
                btnAdd.Enabled    = true;
                btnSave.Enabled   = false;
                //
                txtEmployeeName.Properties.ReadOnly    = true;
                txtEmployeeAddress.Properties.ReadOnly = true;
                dateBirthDay.Properties.ReadOnly       = true;
                txtEmployeeEmail.Properties.ReadOnly   = true;
                cmbEmployeeGender.Properties.ReadOnly  = true;
                txtEmployeePhone.Properties.ReadOnly   = true;
                dateToWork.Properties.ReadOnly         = true;
                lkEmployeeCharge.Properties.ReadOnly   = true;
                //
                grdvListEmployee.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListEmployee.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                m_EmployeeData                    = m_EmployeeExecute.getEmployeeDataFromDatabase();
                grdListEmployee.DataSource        = m_EmployeeData;
                grdvListEmployee.FocusedRowHandle = -1;
                grdvListEmployee.FocusedRowHandle = 0;
                break;
            }

            case "btnCancelOfUpdate":
            {
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                btnUpdate.Visible         = true;
                //
                btnUpdate.Enabled = true;
                btnDelete.Enabled = true;
                btnAdd.Enabled    = true;
                btnSave.Enabled   = false;
                //
                txtEmployeeName.Properties.ReadOnly    = true;
                txtEmployeeAddress.Properties.ReadOnly = true;
                dateBirthDay.Properties.ReadOnly       = true;
                txtEmployeeEmail.Properties.ReadOnly   = true;
                cmbEmployeeGender.Properties.ReadOnly  = true;
                txtEmployeePhone.Properties.ReadOnly   = true;
                dateToWork.Properties.ReadOnly         = true;
                lkEmployeeCharge.Properties.ReadOnly   = true;
                //
                grdvListEmployee.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListEmployee.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                m_EmployeeData                    = m_EmployeeExecute.getEmployeeDataFromDatabase();
                grdListEmployee.DataSource        = m_EmployeeData;
                grdvListEmployee.FocusedRowHandle = -1;
                grdvListEmployee.FocusedRowHandle = 0;
                break;
            }

            case "btnDelete":
            {
                m_EmployeeData                    = m_EmployeeExecute.getEmployeeDataFromDatabase();
                grdListEmployee.DataSource        = m_EmployeeData;
                grdvListEmployee.FocusedRowHandle = grdvListEmployee.DataRowCount - 1;
                m_EmployeeMultiSelect.ClearSelection();
                break;
            }

            case "btnUpdate":
            {
                m_IsAdd = false;
                //
                m_EmployeeMultiSelect.ClearSelection();
                //
                btnUpdate.Visible         = false;
                btnCancelOfUpdate.Visible = true;
                btnAdd.Enabled            = false;
                //
                btnSave.Enabled   = true;
                btnUpdate.Enabled = false;
                btnDelete.Enabled = false;
                //
                txtEmployeeName.Properties.ReadOnly    = false;
                txtEmployeeAddress.Properties.ReadOnly = false;
                dateBirthDay.Properties.ReadOnly       = false;
                txtEmployeeEmail.Properties.ReadOnly   = false;
                cmbEmployeeGender.Properties.ReadOnly  = false;
                txtEmployeePhone.Properties.ReadOnly   = false;
                dateToWork.Properties.ReadOnly         = false;
                lkEmployeeCharge.Properties.ReadOnly   = false;
                //
                grdvListEmployee.OptionsSelection.EnableAppearanceFocusedRow           = false;
                grdvListEmployee.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = false;
                //
                break;
            }

            case "btnSave":
            {
                m_IsAdd           = false;
                btnUpdate.Visible = true;
                btnAdd.Enabled    = true;
                btnDelete.Enabled = true;
                btnUpdate.Enabled = true;
                btnUpdate.Visible = true;
                btnSave.Enabled   = false;
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                //
                txtEmployeeName.Properties.ReadOnly    = true;
                txtEmployeeAddress.Properties.ReadOnly = true;
                dateBirthDay.Properties.ReadOnly       = true;
                dateToWork.Properties.ReadOnly         = true;
                lkEmployeeCharge.Properties.ReadOnly   = true;
                txtEmployeeEmail.Properties.ReadOnly   = true;
                cmbEmployeeGender.Properties.ReadOnly  = true;
                txtEmployeePhone.Properties.ReadOnly   = true;
                //
                grdvListEmployee.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListEmployee.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                m_EmployeeData                    = m_EmployeeExecute.getEmployeeDataFromDatabase();
                grdListEmployee.DataSource        = m_EmployeeData;
                grdvListEmployee.FocusedRowHandle = grdvListEmployee.DataRowCount - 1;
                m_EmployeeMultiSelect.ClearSelection();
                break;
            }
            }
        }
Beispiel #19
0
        private void updateEnableButtonAndResetValueOfControl(ref SimpleButton _btnControl)
        {
            switch (_btnControl.Name)
            {
            case "btnAdd":
            {
                btnAdd.Visible    = false;
                btnCancel.Visible = true;
                //
                btnSave.Enabled   = true;
                btnUpdate.Enabled = false;
                btnDelete.Enabled = false;
                //grdListBookTitles.Enabled = false;
                //
                txtBookTitlesId.Text      = "DS0000**";
                txtBookTitlesName.Text    = null;
                lkBookGenreName.EditValue = null;
                chkCmbAuthorName.SetEditValue(null);
                txtBookTitlesName.Properties.ReadOnly = false;
                lkBookGenreName.Properties.ReadOnly   = false;
                chkCmbAuthorName.Properties.ReadOnly  = false;
                //
                m_IsAdd = true;
                break;
            }

            case "btnCancel":
            {
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                btnUpdate.Visible         = true;
                //
                btnUpdate.Enabled = true;
                btnDelete.Enabled = true;
                btnAdd.Enabled    = true;
                btnSave.Enabled   = false;
                //
                txtBookTitlesName.Properties.ReadOnly = true;
                lkBookGenreName.Properties.ReadOnly   = true;
                chkCmbAuthorName.Properties.ReadOnly  = true;
                //
                m_BookTitlesData                    = m_BookTitlesExecute.getBookTitlesDataFromDatabase();
                grdListBookTitles.DataSource        = m_BookTitlesData;
                grdvListBookTitles.FocusedRowHandle = grdvListBookTitles.DataRowCount - 1;
                break;
            }

            case "btnCacelOfUpdate":
            {
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                btnUpdate.Visible         = true;
                //
                btnUpdate.Enabled = true;
                btnDelete.Enabled = true;
                btnAdd.Enabled    = true;
                btnSave.Enabled   = false;
                //
                txtBookTitlesName.Properties.ReadOnly = true;
                lkBookGenreName.Properties.ReadOnly   = true;
                chkCmbAuthorName.Properties.ReadOnly  = true;
                //
                m_BookTitlesData                    = m_BookTitlesExecute.getBookTitlesDataFromDatabase();
                grdListBookTitles.DataSource        = m_BookTitlesData;
                grdvListBookTitles.FocusedRowHandle = grdvListBookTitles.DataRowCount - 1;
                break;
            }

            case "btnDelete":
            {
                txtBookTitlesName.Properties.ReadOnly = true;
                lkBookGenreName.Properties.ReadOnly   = true;
                chkCmbAuthorName.Properties.ReadOnly  = true;
                //
                m_BookTitlesData                    = m_BookTitlesExecute.getBookTitlesDataFromDatabase();
                grdListBookTitles.DataSource        = m_BookTitlesData;
                grdvListBookTitles.FocusedRowHandle = 0;
                m_BookTitlesMulitSelect.ClearSelection();
                break;
            }

            case "btnUpdate":
            {
                m_IsAdd = false;
                //
                btnUpdate.Visible         = false;
                btnCancelOfUpdate.Visible = true;
                //
                txtBookTitlesName.Properties.ReadOnly = false;
                lkBookGenreName.Properties.ReadOnly   = false;
                chkCmbAuthorName.Properties.ReadOnly  = false;
                //
                btnDelete.Enabled = false;
                btnAdd.Enabled    = false;
                btnSave.Enabled   = true;
                break;
            }

            case "btnSave":
            {
                btnAdd.Enabled    = true;
                btnDelete.Enabled = true;
                btnUpdate.Enabled = true;
                btnSave.Enabled   = false;
                //
                btnUpdate.Visible         = true;
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                //
                txtBookTitlesName.Properties.ReadOnly = true;
                lkBookGenreName.Properties.ReadOnly   = true;
                chkCmbAuthorName.Properties.ReadOnly  = true;
                //
                m_BookTitlesData                    = m_BookTitlesExecute.getBookTitlesDataFromDatabase();
                grdListBookTitles.DataSource        = m_BookTitlesData;
                grdvListBookTitles.FocusedRowHandle = grdvListBookTitles.DataRowCount - 1;
                break;
            }
            }
        }
Beispiel #20
0
        void btnAllocate_Click(object sender, EventArgs e)
        {
            if (gridView1.SelectedRowsCount == 0)
            {
                Common.setMessageBox("Select Record to Close", "Close Period", 1); return;
            }
            else
            {
                //Common.setMessageBox("Sorry TransactionPosting Suspend for now!", "Close Period", 1);
                //return;
                try
                {
                    SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);

                    tableTrans.Clear();

                    if (string.IsNullOrEmpty(selection.SelectedCount.ToString()))
                    {
                        return;
                    }

                    for (int i = 0; i < selection.SelectedCount; i++)
                    {
                        bool chkUpdate = (bool)(selection.GetSelectedRow(i) as DataRowView)["IsApproved"];
                        //BankAccountID,PostingRequestID
                        if (chkUpdate)
                        {
                            tableTrans.Rows.Add(new object[] { (selection.GetSelectedRow(i) as DataRowView)["BankShortCode"], (selection.GetSelectedRow(i) as DataRowView)["FinancialperiodID"], (selection.GetSelectedRow(i) as DataRowView)["StartDate"], (selection.GetSelectedRow(i) as DataRowView)["EndDate"], (selection.GetSelectedRow(i) as DataRowView)["BankAccountID"], (selection.GetSelectedRow(i) as DataRowView)["PostingRequestID"], (selection.GetSelectedRow(i) as DataRowView)["ReconID"] });
                        }
                    }


                    if (tableTrans.Rows.Count <= 0)
                    {
                        Common.setMessageBox("No approved record is selected", "Close Period", 3);
                        return;
                    }

                    selection.ClearSelection();

                    using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                    {
                        connect.Open();
                        _command = new SqlCommand("PostingTransactionApprove", connect)
                        {
                            CommandType = CommandType.StoredProcedure
                        };

                        _command.Parameters.Add(new SqlParameter("@pTransactiondb", SqlDbType.Structured)).Value = tableTrans;
                        _command.Parameters.Add(new SqlParameter("@Userid", SqlDbType.VarChar)).Value            = Program.UserID;
                        _command.CommandTimeout = 0;
                        //_command.Parameters.Add(new SqlParameter("@enddate", SqlDbType.VarChar)).Value = string.Format("{0:yyyy/MM/dd}", dtpEnd.Value);
                        //_command.Parameters.Add(new SqlParameter("@pType", SqlDbType.Bit)).Value = boolIsUpdate2;
                        //_command.Parameters.Add(new SqlParameter("@Batchcode", SqlDbType.Char)).Value = label22.Text;
                        //@Years
                        using (System.Data.DataSet ds = new System.Data.DataSet())
                        {
                            ds.Clear();
                            adp = new SqlDataAdapter(_command);
                            adp.Fill(ds);
                            connect.Close();

                            //&& ds.Tables[0].Rows[0]["returnCode"].ToString() != "01"
                            if (ds.Tables[0].Rows[0]["returnCode"].ToString() != "00" && ds.Tables[0].Rows[0]["returnCode"].ToString() != "01")
                            {
                                if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "-1")
                                {
                                    Common.setMessageBox(ds.Tables[0].Rows[0]["returnMessage"].ToString(), Program.ApplicationName, 2);

                                    return;
                                }
                                if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "-2")
                                {
                                    Common.setMessageBox(ds.Tables[0].Rows[0]["returnMessage"].ToString(), Program.ApplicationName, 2);

                                    using (FrmReportPosting frmreport = new FrmReportPosting(ds))
                                    {
                                        frmreport.ShowDialog();
                                    }
                                    FrmRequest_Load(null, null);

                                    //return;
                                }
                            }
                            else
                            {
                                Common.setMessageBox(ds.Tables[0].Rows[0]["returnMessage"].ToString(), Program.ApplicationName, 2);

                                if (ds.Tables.Count > 1)
                                {                                 //FrmReportPosting report = new FrmReportPosting(ds.Tables[1], ds.Tables[2]);
                                    using (FrmReportPosting frmreport = new FrmReportPosting(ds))
                                    {
                                        frmreport.ShowDialog();
                                    }
                                }
                                FrmRequest_Load(null, null);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    Tripous.Sys.ErrorBox(ex.Message); return;
                }
                finally
                {
                    SplashScreenManager.CloseForm(false);
                }
            }
        }
Beispiel #21
0
        private void updateEnableButtonAndResetValueOfControl(ref SimpleButton _btnControl)
        {
            switch (_btnControl.Name)
            {
            case "btnAdd":
            {
                m_BookMultiSelect.ClearSelection();
                //
                txtBookId.Text    = "SA00000**";
                btnAdd.Visible    = false;
                btnCancel.Visible = true;
                //
                btnSave.Enabled   = true;
                btnUpdate.Enabled = false;
                btnDelete.Enabled = false;
                //
                lkBookTitlesName.Properties.ReadOnly    = false;
                lkPublisherName.Properties.ReadOnly     = false;
                txtBookRealeaseYear.Properties.ReadOnly = false;
                //
                grdvListBook.OptionsSelection.EnableAppearanceFocusedRow           = false;
                grdvListBook.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = false;
                //
                lkBookTitlesName.EditValue    = null;
                lkPublisherName.EditValue     = null;
                txtBookRealeaseYear.EditValue = 0;
                txtBookCount.EditValue        = 0;
                txtBookPrices.EditValue       = 0;
                //
                m_IsAdd = true;
                break;
            }

            case "btnCancel":
            {
                m_IsAdd = false;
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                btnUpdate.Visible         = true;
                //
                btnUpdate.Enabled = true;
                btnDelete.Enabled = true;
                btnAdd.Enabled    = true;
                btnSave.Enabled   = false;
                //
                lkBookTitlesName.Properties.ReadOnly    = true;
                lkPublisherName.Properties.ReadOnly     = true;
                txtBookRealeaseYear.Properties.ReadOnly = true;
                //
                grdvListBook.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListBook.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                m_BookData                    = m_BookExecute.getBookDataFromDatabase();
                grdListBook.DataSource        = m_BookData;
                grdListBookView.DataSource    = m_BookData;
                grdvListBook.FocusedRowHandle = -1;
                grdvListBook.FocusedRowHandle = 0;
                break;
            }

            case "btnCancelOfUpdate":
            {
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                btnUpdate.Visible         = true;
                //
                btnUpdate.Enabled = true;
                btnDelete.Enabled = true;
                btnAdd.Enabled    = true;
                btnSave.Enabled   = false;
                //
                lkBookTitlesName.Properties.ReadOnly    = true;
                lkPublisherName.Properties.ReadOnly     = true;
                txtBookRealeaseYear.Properties.ReadOnly = true;
                //
                grdvListBook.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListBook.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                m_BookData                    = m_BookExecute.getBookDataFromDatabase();
                grdListBook.DataSource        = m_BookData;
                grdListBookView.DataSource    = m_BookData;
                grdvListBook.FocusedRowHandle = -1;
                grdvListBook.FocusedRowHandle = 0;
                break;
            }

            case "btnDelete":
            {
                m_BookData                        = m_BookExecute.getBookDataFromDatabase();
                grdListBook.DataSource            = m_BookData;
                grdListBookView.DataSource        = m_BookData;
                grdvListBook.FocusedRowHandle     = grdvListBook.DataRowCount - 1;
                grdvListBookView.FocusedRowHandle = grdvListBookView.DataRowCount - 1;
                m_BookMultiSelect.ClearSelection();
                break;
            }

            case "btnUpdate":
            {
                m_IsAdd = false;
                //
                m_BookMultiSelect.ClearSelection();
                //
                btnUpdate.Visible         = false;
                btnCancelOfUpdate.Visible = true;
                btnAdd.Enabled            = false;
                //
                btnSave.Enabled   = true;
                btnUpdate.Enabled = false;
                btnDelete.Enabled = false;
                //
                lkBookTitlesName.Properties.ReadOnly    = false;
                lkPublisherName.Properties.ReadOnly     = false;
                txtBookRealeaseYear.Properties.ReadOnly = false;
                //
                grdvListBook.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListBook.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                break;
            }

            case "btnSave":
            {
                m_IsAdd           = false;
                btnUpdate.Visible = true;
                btnAdd.Enabled    = true;
                btnDelete.Enabled = true;
                btnUpdate.Enabled = true;
                btnUpdate.Visible = true;
                btnSave.Enabled   = false;
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                //
                lkBookTitlesName.Properties.ReadOnly    = true;
                lkPublisherName.Properties.ReadOnly     = true;
                txtBookRealeaseYear.Properties.ReadOnly = true;
                //
                grdvListBook.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListBook.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                m_BookData                        = m_BookExecute.getBookDataFromDatabase();
                grdListBook.DataSource            = m_BookData;
                grdListBookView.DataSource        = m_BookData;
                grdvListBook.FocusedRowHandle     = grdvListBook.DataRowCount - 1;
                grdvListBookView.FocusedRowHandle = grdvListBookView.DataRowCount - 1;
                m_BookMultiSelect.ClearSelection();
                break;
            }
            }
        }
 public override void DeleteRowButtonClick()
 {
     dataHandler.DelCheckedRow(selection.CheckMarkColumn);
     selection.ClearSelection();
 }
Beispiel #23
0
        private void updateEnableButtonAndResetValueOfControl(ref SimpleButton _btnControl)
        {
            switch (_btnControl.Name)
            {
            case "btnAdd":
            {
                unitMulitiSelect.ClearSelection();
                //
                btnAdd.Visible    = false;
                btnCancel.Visible = true;
                //
                btnSave.Enabled   = true;
                btnUpdate.Enabled = false;
                btnDelete.Enabled = false;
                //
                txtUnitId.Text   = "DOV0000**";
                txtUnitName.Text = null;
                txtUnitName.Focus();
                txtUnitName.Properties.ReadOnly = false;
                //
                grdvListUnit.OptionsSelection.EnableAppearanceFocusedRow           = false;
                grdvListUnit.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = false;
                //
                m_IsAdd = true;
                break;
            }

            case "btnCancel":
            {
                //
                m_IsAdd = false;
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                btnUpdate.Visible         = true;
                //
                btnUpdate.Enabled = true;
                btnDelete.Enabled = true;
                btnAdd.Enabled    = true;
                btnSave.Enabled   = false;
                //
                txtUnitName.Properties.ReadOnly = true;
                //
                grdvListUnit.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListUnit.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                unitDataTable                 = unitBUS.GetAllUnit();
                grdListUnit.DataSource        = unitDataTable;
                grdvListUnit.FocusedRowHandle = -1;
                grdvListUnit.FocusedRowHandle = 0;
                //
                dxErrorProvider.ClearErrors();
                break;
            }

            case "btnCancelOfUpdate":
            {
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                btnUpdate.Visible         = true;
                //
                btnUpdate.Enabled = true;
                btnDelete.Enabled = true;
                btnAdd.Enabled    = true;
                btnSave.Enabled   = false;
                //
                txtUnitName.Properties.ReadOnly = true;
                //
                grdvListUnit.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListUnit.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                unitDataTable                 = unitBUS.GetAllUnit();
                grdListUnit.DataSource        = unitDataTable;
                grdvListUnit.FocusedRowHandle = -1;
                grdvListUnit.FocusedRowHandle = 0;
                //
                dxErrorProvider.ClearErrors();
                break;
            }

            case "btnDelete":
            {
                txtUnitName.Properties.ReadOnly = true;;
                unitDataTable                 = new DataTable();
                unitDataTable                 = unitBUS.GetAllUnit();
                grdListUnit.DataSource        = unitDataTable;
                grdvListUnit.FocusedRowHandle = 0;
                unitMulitiSelect.ClearSelection();
                InitControlByData();
                break;
            }

            case "btnUpdate":
            {
                unitMulitiSelect.ClearSelection();
                m_IsAdd = false;
                //
                btnUpdate.Visible         = false;
                btnCancelOfUpdate.Visible = true;
                //
                txtUnitName.Focus();
                txtUnitName.Properties.ReadOnly = false;
                //
                grdvListUnit.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListUnit.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = false;
                //
                btnDelete.Enabled = false;
                btnAdd.Enabled    = false;
                btnSave.Enabled   = true;
                break;
            }

            case "btnSave":
            {
                m_IsAdd           = false;
                btnAdd.Enabled    = true;
                btnDelete.Enabled = true;
                btnUpdate.Enabled = true;
                btnSave.Enabled   = false;
                //
                btnUpdate.Visible         = true;
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                //
                txtUnitName.Properties.ReadOnly = true;
                //
                grdvListUnit.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListUnit.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                unitDataTable                 = unitBUS.GetAllUnit();
                grdListUnit.DataSource        = unitDataTable;
                grdvListUnit.FocusedRowHandle = grdvListUnit.DataRowCount - 1;
                break;
            }
            }
        }
Beispiel #24
0
        private void updateEnableButtonAndResetValueOfControl(ref SimpleButton _btnControl)
        {
            switch (_btnControl.Name)
            {
            case "btnAdd":
            {
                customerMultiSelect.ClearSelection();
                //
                txtCustomerId.Text = "KH00000**";
                btnAdd.Visible     = false;
                btnCancel.Visible  = true;
                //
                btnSave.Enabled   = true;
                btnUpdate.Enabled = false;
                btnDelete.Enabled = false;
                //
                txtCustomerName.Properties.ReadOnly = false;
                txtCustomerName.Focus();
                txtCustomerAddress.Properties.ReadOnly = false;
                dateBirthDay.Properties.ReadOnly       = false;
                txtCustomerEmail.Properties.ReadOnly   = false;
                cmbCustomerGender.Properties.ReadOnly  = false;
                txtCustomerPhone.Properties.ReadOnly   = false;
                txtCMND.Properties.ReadOnly            = false;
                //
                grdvListCustomer.OptionsSelection.EnableAppearanceFocusedRow           = false;
                grdvListCustomer.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = false;
                //
                txtCustomerName.EditValue    = null;
                txtCustomerAddress.EditValue = null;
                dateBirthDay.EditValue       = null;
                txtCustomerEmail.EditValue   = null;
                cmbCustomerGender.EditValue  = null;
                txtCustomerPhone.EditValue   = null;
                txtCMND.EditValue            = null;
                //
                m_IsAdd = true;
                break;
            }

            case "btnCancel":
            {
                m_IsAdd = false;
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                btnUpdate.Visible         = true;
                //
                btnUpdate.Enabled = true;
                btnDelete.Enabled = true;
                btnAdd.Enabled    = true;
                btnSave.Enabled   = false;
                //
                txtCustomerName.Properties.ReadOnly    = true;
                txtCustomerAddress.Properties.ReadOnly = true;
                dateBirthDay.Properties.ReadOnly       = true;
                txtCustomerEmail.Properties.ReadOnly   = true;
                cmbCustomerGender.Properties.ReadOnly  = true;
                txtCustomerPhone.Properties.ReadOnly   = true;
                txtCMND.Properties.ReadOnly            = true;
                //
                grdvListCustomer.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListCustomer.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                customerDataTable                 = customerBUS.GetAllCustomer();
                grdListCustomer.DataSource        = customerDataTable;
                grdvListCustomer.FocusedRowHandle = -1;
                grdvListCustomer.FocusedRowHandle = 0;
                //
                dxErrorProvider.ClearErrors();
                break;
            }

            case "btnCancelOfUpdate":
            {
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                btnUpdate.Visible         = true;
                //
                btnUpdate.Enabled = true;
                btnDelete.Enabled = true;
                btnAdd.Enabled    = true;
                btnSave.Enabled   = false;
                //
                txtCustomerName.Properties.ReadOnly    = true;
                txtCustomerAddress.Properties.ReadOnly = true;
                dateBirthDay.Properties.ReadOnly       = true;
                txtCustomerEmail.Properties.ReadOnly   = true;
                cmbCustomerGender.Properties.ReadOnly  = true;
                txtCustomerPhone.Properties.ReadOnly   = true;
                txtCMND.Properties.ReadOnly            = true;
                //
                grdvListCustomer.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListCustomer.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                customerDataTable                 = customerBUS.GetAllCustomer();
                grdListCustomer.DataSource        = customerDataTable;
                grdvListCustomer.FocusedRowHandle = -1;
                grdvListCustomer.FocusedRowHandle = 0;
                break;
            }

            case "btnDelete":
            {
                customerDataTable                 = customerBUS.GetAllCustomer();
                grdListCustomer.DataSource        = customerDataTable;
                grdvListCustomer.FocusedRowHandle = grdvListCustomer.DataRowCount - 1;
                customerMultiSelect.ClearSelection();
                break;
            }

            case "btnUpdate":
            {
                m_IsAdd = false;
                //
                customerMultiSelect.ClearSelection();
                //
                btnUpdate.Visible         = false;
                btnCancelOfUpdate.Visible = true;
                btnAdd.Enabled            = false;
                //
                btnSave.Enabled   = true;
                btnUpdate.Enabled = false;
                btnDelete.Enabled = false;
                //
                txtCustomerName.Properties.ReadOnly = false;
                txtCustomerName.Focus();
                txtCustomerAddress.Properties.ReadOnly = false;
                dateBirthDay.Properties.ReadOnly       = false;
                txtCustomerEmail.Properties.ReadOnly   = false;
                cmbCustomerGender.Properties.ReadOnly  = false;
                txtCustomerPhone.Properties.ReadOnly   = false;
                txtCMND.Properties.ReadOnly            = false;
                //
                grdvListCustomer.OptionsSelection.EnableAppearanceFocusedRow           = false;
                grdvListCustomer.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = false;
                //
                break;
            }

            case "btnSave":
            {
                m_IsAdd           = false;
                btnUpdate.Visible = true;
                btnAdd.Enabled    = true;
                btnDelete.Enabled = true;
                btnUpdate.Enabled = true;
                btnUpdate.Visible = true;
                btnSave.Enabled   = false;
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                //
                txtCustomerName.Properties.ReadOnly    = true;
                txtCustomerAddress.Properties.ReadOnly = true;
                dateBirthDay.Properties.ReadOnly       = true;
                txtCustomerEmail.Properties.ReadOnly   = true;
                cmbCustomerGender.Properties.ReadOnly  = true;
                txtCustomerPhone.Properties.ReadOnly   = true;
                txtCMND.Properties.ReadOnly            = true;
                //
                grdvListCustomer.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListCustomer.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                customerDataTable                 = customerBUS.GetAllCustomer();
                grdListCustomer.DataSource        = customerDataTable;
                grdvListCustomer.FocusedRowHandle = grdvListCustomer.DataRowCount - 1;
                customerMultiSelect.ClearSelection();
                //
                dxErrorProvider.ClearErrors();
                break;
            }
            }
        }
        private void updateEnableButtonAndResetValueOfControl(ref SimpleButton _btnControl)
        {
            switch (_btnControl.Name)
            {
            case "btnAdd":
            {
                m_AuthorMulitSelect.ClearSelection();
                //
                btnAdd.Visible    = false;
                btnCancel.Visible = true;
                //
                btnSave.Enabled   = true;
                btnUpdate.Enabled = false;
                btnDelete.Enabled = false;
                //
                txtAuthorId.Text      = "TG0000**";
                txtAuthorName.Text    = null;
                txtAuthorAddress.Text = null;
                txtAuthorAddress.Properties.ReadOnly = false;
                txtAuthorName.Properties.ReadOnly    = false;
                //
                grdvListAuthor.OptionsSelection.EnableAppearanceFocusedRow           = false;
                grdvListAuthor.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = false;
                //
                m_IsAdd = true;
                break;
            }

            case "btnCancel":
            {
                //
                m_IsAdd = false;
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                btnUpdate.Visible         = true;
                //
                btnUpdate.Enabled = true;
                btnDelete.Enabled = true;
                btnAdd.Enabled    = true;
                btnSave.Enabled   = false;
                //
                txtAuthorName.Properties.ReadOnly    = true;
                txtAuthorAddress.Properties.ReadOnly = true;
                //
                grdvListAuthor.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListAuthor.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                m_AuthorData                    = m_AuthorExecute.getAuthorDataFromDatabase();
                grdListAuthor.DataSource        = m_AuthorData;
                grdvListAuthor.FocusedRowHandle = -1;
                grdvListAuthor.FocusedRowHandle = 0;
                break;
            }

            case "btnCancelOfUpdate":
            {
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                btnUpdate.Visible         = true;
                //
                btnUpdate.Enabled = true;
                btnDelete.Enabled = true;
                btnAdd.Enabled    = true;
                btnSave.Enabled   = false;
                //
                txtAuthorName.Properties.ReadOnly    = true;
                txtAuthorAddress.Properties.ReadOnly = true;
                //
                grdvListAuthor.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListAuthor.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                m_AuthorData                    = m_AuthorExecute.getAuthorDataFromDatabase();
                grdListAuthor.DataSource        = m_AuthorData;
                grdvListAuthor.FocusedRowHandle = -1;
                grdvListAuthor.FocusedRowHandle = 0;
                break;
            }

            case "btnDelete":
            {
                txtAuthorName.Properties.ReadOnly    = true;
                txtAuthorAddress.Properties.ReadOnly = true;
                m_AuthorData                    = new DataTable();
                m_AuthorData                    = m_AuthorExecute.getAuthorDataFromDatabase();
                grdListAuthor.DataSource        = m_AuthorData;
                grdvListAuthor.FocusedRowHandle = 0;
                m_AuthorMulitSelect.ClearSelection();
                break;
            }

            case "btnUpdate":
            {
                m_AuthorMulitSelect.ClearSelection();
                m_IsAdd = false;
                //
                btnUpdate.Visible         = false;
                btnCancelOfUpdate.Visible = true;
                //
                txtAuthorName.Properties.ReadOnly    = false;
                txtAuthorAddress.Properties.ReadOnly = false;
                //
                grdvListAuthor.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListAuthor.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = false;
                //
                btnDelete.Enabled = false;
                btnAdd.Enabled    = false;
                btnSave.Enabled   = true;
                break;
            }

            case "btnSave":
            {
                m_IsAdd           = false;
                btnAdd.Enabled    = true;
                btnDelete.Enabled = true;
                btnUpdate.Enabled = true;
                btnSave.Enabled   = false;
                //
                btnUpdate.Visible         = true;
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                //
                txtAuthorName.Properties.ReadOnly    = true;
                txtAuthorAddress.Properties.ReadOnly = true;
                //
                grdvListAuthor.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListAuthor.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                m_AuthorData                    = m_AuthorExecute.getAuthorDataFromDatabase();
                grdListAuthor.DataSource        = m_AuthorData;
                grdvListAuthor.FocusedRowHandle = grdvListAuthor.DataRowCount - 1;
                break;
            }
            }
        }
        private void updateEnableButtonAndResetValueOfControl(ref SimpleButton _btnControl)
        {
            switch (_btnControl.Name)
            {
            case "btnAdd":
            {
                m_ChargeMultiSelectItem.ClearSelection();
                //
                btnAdd.Visible    = false;
                btnCancel.Visible = true;
                //
                btnSave.Enabled   = true;
                btnUpdate.Enabled = false;
                btnDelete.Enabled = false;
                //
                txtChargeId.Text   = "CV00000**";
                txtChargeName.Text = null;
                txtChargeName.Properties.ReadOnly = false;
                grdvListCharge.OptionsSelection.EnableAppearanceFocusedRow           = false;
                grdvListCharge.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = false;
                //
                m_IsAdd = true;
                break;
            }

            case "btnCancel":
            {
                //
                m_IsAdd = false;
                dxErrorProvider.ClearErrors();
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                btnUpdate.Visible         = true;
                //
                btnUpdate.Enabled = true;
                btnDelete.Enabled = true;
                btnAdd.Enabled    = true;
                btnSave.Enabled   = false;
                //
                txtChargeName.Properties.ReadOnly = true;
                //
                grdvListCharge.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListCharge.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                m_ChargeData                    = m_ChargeBus.getChargeDataFromDatabase();
                grdListCharge.DataSource        = m_ChargeData;
                grdvListCharge.FocusedRowHandle = -1;
                grdvListCharge.FocusedRowHandle = 0;
                //
                break;
            }

            case "btnCancelOfUpdate":
            {
                //
                dxErrorProvider.ClearErrors();
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                btnUpdate.Visible         = true;
                //
                btnUpdate.Enabled = true;
                btnDelete.Enabled = true;
                btnAdd.Enabled    = true;
                btnSave.Enabled   = false;
                //
                txtChargeName.Properties.ReadOnly = true;
                //
                grdvListCharge.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListCharge.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                m_ChargeData = m_ChargeBus.getChargeDataFromDatabase();
                grdvListCharge.FocusedRowHandle = -1;
                grdvListCharge.FocusedRowHandle = 0;
                break;
            }

            case "btnDelete":
            {
                txtChargeName.Properties.ReadOnly = true;
                //
                m_ChargeData                    = m_ChargeBus.getChargeDataFromDatabase();
                grdListCharge.DataSource        = m_ChargeData;
                grdvListCharge.FocusedRowHandle = -1;
                grdvListCharge.FocusedRowHandle = 0;
                //
                m_ChargeMultiSelectItem.ClearSelection();
                break;
            }

            case "btnUpdate":
            {
                m_ChargeMultiSelectItem.ClearSelection();
                //
                m_IsAdd = false;
                //
                btnUpdate.Visible         = false;
                btnCancelOfUpdate.Visible = true;
                //
                txtChargeName.Properties.ReadOnly = false;
                //
                grdvListCharge.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListCharge.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = false;
                //
                btnDelete.Enabled = false;
                btnAdd.Enabled    = false;
                btnSave.Enabled   = true;
                break;
            }

            case "btnSave":
            {
                //
                m_IsAdd = false;
                dxErrorProvider.ClearErrors();
                //
                btnUpdate.Visible = true;
                btnAdd.Enabled    = true;
                btnSave.Enabled   = false;
                btnDelete.Enabled = true;
                btnUpdate.Enabled = true;
                btnUpdate.Visible = true;
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                //
                txtChargeName.Properties.ReadOnly = false;
                //
                grdvListCharge.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListCharge.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                m_ChargeData                    = m_ChargeBus.getChargeDataFromDatabase();
                grdListCharge.DataSource        = m_ChargeData;
                grdvListCharge.FocusedRowHandle = grdvListCharge.DataRowCount - 1;
                break;
            }
            }
        }
Beispiel #27
0
        private void btnDeleteRow_Click(object sender, EventArgs e)
        {
            dataHandler.DelCheckedRow(selection.CheckMarkColumn);

            selection.ClearSelection();
        }
Beispiel #28
0
 private void btnCancelChooseRoom_Click(object sender, EventArgs e)
 {
     roomMulitiSelect.ClearSelection();
 }
 private void btnDel_Click(object sender, EventArgs e)
 {
     dataHandler.DelCheckedRow(grvShopFile.Columns.ColumnByFieldName("CheckMarkSelection"));
     selection.ClearSelection();
 }
Beispiel #30
0
        private void updateEnableButtonAndResetValueOfControl(ref SimpleButton _btnControl)
        {
            switch (_btnControl.Name)
            {
            case "btnAdd":
            {
                staffMultiSelect.ClearSelection();
                //
                txtStaffId.Text   = "NV00000**";
                btnAdd.Visible    = false;
                btnCancel.Visible = true;
                //
                btnSave.Enabled   = true;
                btnUpdate.Enabled = false;
                btnDelete.Enabled = false;
                //
                txtStaffName.Properties.ReadOnly = false;
                txtStaffName.Focus();
                txtStaffAddress.Properties.ReadOnly = false;
                dateBirthDay.Properties.ReadOnly    = false;
                txtStaffEmail.Properties.ReadOnly   = false;
                cmbStaffGender.Properties.ReadOnly  = false;
                txtStaffPhone.Properties.ReadOnly   = false;
                dateToWork.Properties.ReadOnly      = false;
                lkStaffCharge.Properties.ReadOnly   = false;
                //
                grdvListStaff.OptionsSelection.EnableAppearanceFocusedRow           = false;
                grdvListStaff.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = false;
                //
                txtStaffName.EditValue    = null;
                txtStaffAddress.EditValue = null;
                dateBirthDay.EditValue    = null;
                dateToWork.EditValue      = null;
                txtStaffEmail.EditValue   = null;
                cmbStaffGender.EditValue  = null;
                txtStaffPhone.EditValue   = null;
                //
                m_IsAdd = true;
                break;
            }

            case "btnCancel":
            {
                m_IsAdd = false;
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                btnUpdate.Visible         = true;
                //
                btnUpdate.Enabled = true;
                btnDelete.Enabled = true;
                btnAdd.Enabled    = true;
                btnSave.Enabled   = false;
                //
                txtStaffName.Properties.ReadOnly    = true;
                txtStaffAddress.Properties.ReadOnly = true;
                dateBirthDay.Properties.ReadOnly    = true;
                txtStaffEmail.Properties.ReadOnly   = true;
                cmbStaffGender.Properties.ReadOnly  = true;
                txtStaffPhone.Properties.ReadOnly   = true;
                dateToWork.Properties.ReadOnly      = true;
                lkStaffCharge.Properties.ReadOnly   = true;
                //
                grdvListStaff.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListStaff.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                staffDataTable                 = staffBUS.GetAllStaff();
                grdListStaff.DataSource        = staffDataTable;
                grdvListStaff.FocusedRowHandle = -1;
                grdvListStaff.FocusedRowHandle = 0;
                //
                dxErrorProvider.ClearErrors();
                break;
            }

            case "btnCancelOfUpdate":
            {
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                btnUpdate.Visible         = true;
                //
                btnUpdate.Enabled = true;
                btnDelete.Enabled = true;
                btnAdd.Enabled    = true;
                btnSave.Enabled   = false;
                //
                txtStaffName.Properties.ReadOnly    = true;
                txtStaffAddress.Properties.ReadOnly = true;
                dateBirthDay.Properties.ReadOnly    = true;
                txtStaffEmail.Properties.ReadOnly   = true;
                cmbStaffGender.Properties.ReadOnly  = true;
                txtStaffPhone.Properties.ReadOnly   = true;
                dateToWork.Properties.ReadOnly      = true;
                lkStaffCharge.Properties.ReadOnly   = true;
                //
                grdvListStaff.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListStaff.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                staffDataTable                 = staffBUS.GetAllStaff();
                grdListStaff.DataSource        = staffDataTable;
                grdvListStaff.FocusedRowHandle = -1;
                grdvListStaff.FocusedRowHandle = 0;
                break;
            }

            case "btnDelete":
            {
                staffDataTable                 = staffBUS.GetAllStaff();
                grdListStaff.DataSource        = staffDataTable;
                grdvListStaff.FocusedRowHandle = grdvListStaff.DataRowCount - 1;
                staffMultiSelect.ClearSelection();
                break;
            }

            case "btnUpdate":
            {
                m_IsAdd = false;
                //
                staffMultiSelect.ClearSelection();
                //
                btnUpdate.Visible         = false;
                btnCancelOfUpdate.Visible = true;
                btnAdd.Enabled            = false;
                //
                btnSave.Enabled   = true;
                btnUpdate.Enabled = false;
                btnDelete.Enabled = false;
                //
                txtStaffName.Properties.ReadOnly = false;
                txtStaffName.Focus();
                txtStaffAddress.Properties.ReadOnly = false;
                dateBirthDay.Properties.ReadOnly    = false;
                txtStaffEmail.Properties.ReadOnly   = false;
                cmbStaffGender.Properties.ReadOnly  = false;
                txtStaffPhone.Properties.ReadOnly   = false;
                dateToWork.Properties.ReadOnly      = false;
                lkStaffCharge.Properties.ReadOnly   = false;
                //
                grdvListStaff.OptionsSelection.EnableAppearanceFocusedRow           = false;
                grdvListStaff.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = false;
                //
                break;
            }

            case "btnSave":
            {
                m_IsAdd           = false;
                btnUpdate.Visible = true;
                btnAdd.Enabled    = true;
                btnDelete.Enabled = true;
                btnUpdate.Enabled = true;
                btnUpdate.Visible = true;
                btnSave.Enabled   = false;
                //
                btnAdd.Visible            = true;
                btnCancel.Visible         = false;
                btnCancelOfUpdate.Visible = false;
                //
                txtStaffName.Properties.ReadOnly    = true;
                txtStaffAddress.Properties.ReadOnly = true;
                dateBirthDay.Properties.ReadOnly    = true;
                dateToWork.Properties.ReadOnly      = true;
                lkStaffCharge.Properties.ReadOnly   = true;
                txtStaffEmail.Properties.ReadOnly   = true;
                cmbStaffGender.Properties.ReadOnly  = true;
                txtStaffPhone.Properties.ReadOnly   = true;
                //
                grdvListStaff.OptionsSelection.EnableAppearanceFocusedRow           = true;
                grdvListStaff.Columns["CheckMarkSelection"].OptionsColumn.AllowEdit = true;
                //
                staffDataTable                 = staffBUS.GetAllStaff();
                grdListStaff.DataSource        = staffDataTable;
                grdvListStaff.FocusedRowHandle = grdvListStaff.DataRowCount - 1;
                staffMultiSelect.ClearSelection();
                //
                dxErrorProvider.ClearErrors();
                break;
            }
            }
        }