private void cmbLockerStatus_SelectedIndexChanged(object sender, System.EventArgs e) { if (cmbLockerStatus.EditValue.ToString() == "0") { DataRow dr; dr = GridViewLocker.GetDataRow(GridViewLocker.FocusedRowHandle); if (dr != null) { if (dr["Status"].ToString() != "Occupied") { //btnBlock.Enabled = false; //btnUnBlock.Enabled = true; btnTransfer.Enabled = true; } else { btnTransfer.Enabled = false; } } } if (cmbLockerStatus.EditValue.ToString() == "1") { //btnBlock.Enabled = false; //btnUnBlock.Enabled = true; btnTransfer.Enabled = true; } else { //btnBlock.Enabled = true; //btnUnBlock.Enabled = false; btnTransfer.Enabled = false; } initLockerMaintenance(); }
private void simpleButton_SaveStu_Click(object sender, System.EventArgs e) { // isForStudent = true; // lastSyncIndex = 0; // isSendCustomButtonSucceed = false; // simpleButton_SaveStu.Enabled = false; // simpleButton_SaveTea.Enabled = false; // BeginToSendCustomButtonInfo(); /*以上是新功能*/ FlowStateSystem flowStateSystem = new FlowStateSystem(); for (int i = 0; i < gridView3.RowCount; i++) { Int16 stateID = (Int16)(Convert.ToInt16(gridView3.GetDataRow(i)["state_flowState"]) + 5); string stateName = gridView3.GetDataRow(i)["state_flowStateName"].ToString(); flowStateSystem.UpdateStuState(stateID, stateName); //BeginToSendCustomButtonInfo(); // if (isSendCustomButtonSucceed) // { // flowStateSystem.UpdateStuState(stateID,stateName); // } // else // { // MessageBox.Show("保存失败,请重试!", "系统信息!", MessageBoxButtons.OK, MessageBoxIcon.Error); // return; // } } MessageBox.Show("保存成功.", "系统信息!", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void XtraRepositoryItemPopupContainerEdit_QueryCloseUp(object sender, CancelEventArgs e) { DataRow dr = gridView1Popup.GetDataRow(gridView1Popup.FocusedRowHandle); onAfterPopupQueryClose(new XtraRepositoryItemEventArg()); setPopupFocusedRowHandle(dr); }
private void FormTopUpCredit_Load(object sender, System.EventArgs e) { DataRow r = GridView11.GetDataRow(GridView11.FocusedRowHandle); if (r != null) { if (System.Convert.ToInt32(r["Balance"]) > 0) { tblCreditPackageRestrictionTableAdapter.Fill(this.dsCreditPackageRestrition.tblCreditPackageRestriction, r["strCreditPackageCode"].ToString(), System.Convert.ToDecimal(r["Balance"])); //this.dsCreditPackageRestrition.tblCreditPackageRestriction.Select("mListPrice = " + r["Balance"].ToString()); } } }
private void gridView1_CalcRowHeight(object sender, DevExpress.XtraGrid.Views.Grid.RowHeightEventArgs e) { object rowHeight = rowsSizes[gridView1.GetDataRow(e.RowHandle)]; if (rowHeight != null) { e.RowHeight = Convert.ToInt32(rowHeight); } else { e.RowHeight = defaultRowHeight; } }
//multi private void simpleButton_EditPhoneNum_Click(object sender, System.EventArgs e) { chosenPhoneNum = string.Empty; if (gridView2.RowCount != 0) { for (int i = 0; i < gridView2.RowCount; i++) { chosenPhoneNum += gridView2.GetDataRow(i)["mobilePhone_number"].ToString(); chosenPhoneNum += ","; } } this.Close(); }
private void SelectItem() { if (grdView.RowCount > 0) { System.Data.DataRow Row = grdView.GetDataRow(grdView.GetSelectedRows()[0]); selectedDescription = (string)Row["DESCRIPTION"]; selectedSubCodeId = (string)Row["SUBCODEID"]; triggerCode = (string)Row["TRIGGERCODE"]; triggerFunction = (int)Row["TRIGGERFUNCTION"]; priceType = (int)Row["PRICETYPE"]; amountPercent = (decimal)Row["AMOUNTPERCENT"]; this.DialogResult = System.Windows.Forms.DialogResult.OK; Close(); } }
private void btnDown_Click(object sender, EventArgs e) { grdView.MoveNextPage(); int topRowIndex = grdView.TopRowIndex; if ((grdView.IsLastRow) && (grdView.RowCount > 0)) { System.Data.DataRow Row = grdView.GetDataRow(grdView.GetSelectedRows()[0]); string lastItemName = Row["INVENTSERIALID"].ToString(); itemTable.Merge(GetItemList(lastItemName, txtKeyboardInput.Text, getHowManyRows)); grdView.TopRowIndex = topRowIndex; } txtKeyboardInput.Select(); }
private void login_SetMachineVolumnSuccessed() { timer_SetMachineVolumn.Enabled = false; Login.COM_PORT_IS_BUSY = false; login.setMachineVolumn.Resume(); for (int i = 0; i < gridView2.DataRowCount; i++) { int machineAddr = Convert.ToInt32(gridView2.GetDataRow(i)["machine_address"]); int machineVolumn = Convert.ToInt32(gridView2.GetDataRow(i)["machine_volumn"]); new MachineSystem().InsertClassMachine(machineAddr, machineVolumn); } // simpleButton4.Enabled = true; }
private void simpleButton_SaveStu_Click(object sender, System.EventArgs e) { FlowStateSystem flowStateSystem = new FlowStateSystem(); for (int i = 0; i < gridView3.RowCount; i++) { Int16 stateID = (Int16)(Convert.ToInt16(gridView3.GetDataRow(i)["state_flowState"]) + 5); string stateName = gridView3.GetDataRow(i)["state_flowStateName"].ToString(); flowStateSystem.UpdateStuState(stateID, stateName); } MessageBox.Show("保存成功.", "系统信息!", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void gridView_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e) { DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView; DataRow row = view.GetDataRow(e.RowHandle); if (row != null) { object asidurumu; try { asidurumu = row["Aşı Yapıldı"]; } catch (Exception) { asidurumu = null; } if (asidurumu != null && asidurumu != System.DBNull.Value) { mymodel.myenum.TakvimSatirDurumu durum = (mymodel.myenum.TakvimSatirDurumu)Enum.Parse(typeof(mymodel.myenum.TakvimSatirDurumu), asidurumu.ToString()); switch (durum) { case mymodel.myenum.TakvimSatirDurumu.Yapıldı: e.Appearance.BackColor = System.Drawing.Color.LawnGreen; break; default: break; } } } }
private void simpleButtonOK_Click(object sender, System.EventArgs e) { decimal paymentAmt = 0; DataRow r = GridView11.GetDataRow(GridView11.FocusedRowHandle); if (txtEdtTotalAmt.Text.Length > 0 && r != null) { try { paymentAmt = ACMS.Convert.ToDecimal(txtEdtTotalAmt.EditValue); myPOS.NewReceiptEntry(r["nCreditPackageID"].ToString(), -1, string.Format("Top Up Credit Package ID : {0}", r["nCreditPackageID"].ToString()), 1, paymentAmt, r["strCreditPackageCode"].ToString()); } catch (Exception) { MessageBox.Show(this, "Invalid Top Up amount."); this.DialogResult = DialogResult.None; return; } } else { MessageBox.Show(this, "Invalid Top Up amount."); this.DialogResult = DialogResult.None; return; } }
private void simpleButtonOK_Click(object sender, System.EventArgs e) { DataRow r = gridView1.GetDataRow(gridView1.FocusedRowHandle); if (r != null) { if (r["Status"].ToString() == "Exceed Grace Period") { MessageBox.Show(this, "The locker have exceeded the grace period! She can only extend the locker."); return; } ACMSDAL.TblReceiptEntries sqlReceiptEntries = new ACMSDAL.TblReceiptEntries(); DataTable table = sqlReceiptEntries.GetLockerDepositBaseStrReceiptNo_N_NLockerNO(r["strReceiptNo"].ToString(), r["nLockerNo"].ToString()); decimal lockerDeposit = ACMS.Convert.ToDecimal(table.Rows[0]["MSubTotal"]); myPOS.NewReceiptEntry(r["nLockerNo"].ToString(), -1, "Return Locker", 1, -lockerDeposit, r["nLockerNo"].ToString()); this.Close(); } if (myPOS.ReceiptItemsTable.Rows.Count == 0) { myPOS.POSLockerAction = ACMSLogic.POS.LockerAction.None; } }
private void gvFileList_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e) { try { DevExpress.XtraGrid.Views.Grid.GridView gv = sender as DevExpress.XtraGrid.Views.Grid.GridView; DataRow r = gv.GetDataRow(e.RowHandle); //con.Expression = "!(FILEDATE = FILE_FILEDATE AND VERSION = FILE_VERSION)"; string comp = Fnc.obj2String(r["comptype"]); bool isUp = false; if (comp.Equals("A") || comp.Equals("F")) { isUp = !Fnc.obj2String(r["FILEDATE"]).Equals(Fnc.obj2String(r["FILE_FILEDATE"])); } if (!isUp && (comp.Equals("A") || comp.Equals("V"))) { isUp = !Fnc.obj2String(r["VERSION"]).Equals(Fnc.obj2String(r["FILE_VERSION"])); } if (isUp) { e.Appearance.BackColor = Color.LightCoral; } } catch { } }
/// <summary> /// 그리드 그룹별 색상 변경 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gvSettingList_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e) { if (gvSettingList.FocusedRowHandle == e.RowHandle) { return; } DevExpress.XtraGrid.Views.Grid.GridView gv = sender as DevExpress.XtraGrid.Views.Grid.GridView; DataRow r = gv.GetDataRow(e.RowHandle); int idx = 0; int i = 0; string groupName = Fnc.obj2String(r["GroupName"]); foreach (DataRow dr in dsSetting.Tables[fnc.GroupTable_Name].Rows) { if (Fnc.obj2String(dr["GroupName"]).Equals(groupName)) { idx = i % groupColors.Length; break; } i++; } e.Appearance.BackColor = groupColors[idx]; }
private void gridView3_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { DataRow drDetl = gridView3.GetDataRow(e.RowHandle); int output = 0; if (drDetl != null) { SqlHelper.ExecuteNonQuery(connection, "UP_tblPayrollSalesCommDetails", new SqlParameter("@RET_VAL", output), new SqlParameter("@CMD", "U"), new SqlParameter("@nPayrollID", drDetl["nPayrollID"]), new SqlParameter("@nEmployeeID", drDetl["nEmployeeID"]), new SqlParameter("@strSalesCategory", drDetl["strSalesCategory"]), new SqlParameter("@mTotalCommission", Convert.ToDecimal(drDetl["mTotalCommission"])) ); SqlHelper.ExecuteNonQuery(connection, "UP_TblPayrollEntriesComm", new SqlParameter("@nPayrollID", drDetl["nPayrollID"]), new SqlParameter("@nPayrollID", drDetl["nEmployeeID"]) ); } /* DatarRow drDetl = gridView1.GetDataRow(gridView1.FocusedRowHandle); * SqlHelper.ExecuteNonQuery(connection,"UP_tblPayrollSPAServiceCommDetails", * new SqlParameter("@RET_VAL",output), * new SqlParameter("@CMD","U"), * new SqlParameter("@nPayrollID",nPayrollID), * new SqlParameter("@nEmployeeID",Convert.ToInt32(drDetl["nEmplyeeID"])), * new SqlParameter("@dtDate",ConvertToDateTime(drDetl["dtDate"])), * new SqlParameter("@strBranchCode",drDetl["strBranchCode"].ToString()), * new SqlParameter("@strServiceCode",drDetl["strServiceCode"].ToString()), * new SqlParameter("@mCommission",Convert.ToDecimal(drDetl["mCommission"])) * ); */ }
//private void panelControlPackage_Paint(object sender, System.Windows.Forms.PaintEventArgs e) //{ //} private void simpleButton3_Click(object sender, System.EventArgs e) { DataRow r = gridViewMemberPackage.GetDataRow(gridViewMemberPackage.FocusedRowHandle); if (r != null) { //insert an giro package ID to the myPos myPOS.NExtendGIROpkg = ACMS.Convert.ToInt32(r["nPackageID"]); //decimal mUnitPrice = myPOS.NCategoryID == 2 ? 128m : 118m; if (myPOS.NCategoryID == 35 && r["strPackageCode"].ToString().Contains("GIRO(fit)")) { myPOS.NCategoryID = 2; } else { myPOS.NCategoryID = 35; } decimal mUnitPrice = myPOS.NCategoryID == 34 ? 118m:ACMS.Convert.ToInt32(r["mListPrice"]); string strReceiptDesc = myPOS.NCategoryID == 34 ? "Extend SPA GIRO package":"Extend Member GIRO package"; //decimal mUnitPrice = myPOS.NCategoryID == 2 ? ACMS.Convert.ToInt32(r["mListPrice"]) : 118m; //string strReceiptDesc = myPOS.NCategoryID == 2 ? "Extend Member GIRO package" : "Extend SPA GIRO package"; myPOS.NewReceiptEntry(r["nPackageID"].ToString(), myPOS.NCategoryID, strReceiptDesc, 1, mUnitPrice, ""); } }
private void simpleButtonOK_Click(object sender, System.EventArgs e) { DataRow r = GridView7.GetDataRow(GridView7.FocusedRowHandle); if (r != null) { ACMS.ACMSPOS2.FormGetService frm = new FormGetService(StrPackageCode); DialogResult result = frm.ShowDialog(this); if (result == DialogResult.OK) { decimal unitPrice = frm.BasePrice - PackageBaseUnitPrice; if (unitPrice < 0) { unitPrice = 0; } myPOS.NewReceiptEntry(frm.StrServiceCode, -1, "Top Up Single Treatment For Member Package : " + NPackageID.ToString(), 1, unitPrice, NPackageID.ToString()); this.Close(); } else { this.DialogResult = DialogResult.None; return; } } }
private void repImg_Popup(object sender, EventArgs e) { if (!(sender is DevExpress.XtraEditors.ImageEdit)) return; DevExpress.XtraEditors.ImageEdit repImg = sender as DevExpress.XtraEditors.ImageEdit; DevExpress.XtraGrid.Views.Grid.GridView gv = (repImg.Parent as DevExpress.XtraGrid.GridControl).MainView as DevExpress.XtraGrid.Views.Grid.GridView; DataRow _tpDr = gv.GetDataRow(gv.FocusedRowHandle); if (_tpDr["Icon"].Equals(System.DBNull.Value)) { byte[] _tpBytes = ServerRefManager.PicFileRead(_tpDr["StylePic"].ToString(), _tpDr["Pic_Version"].ToString()); gv.FocusedColumn = gv.Columns["Icon"]; gv.ShowEditor(); if (gv.ActiveEditor is DevExpress.XtraEditors.ImageEdit) { if (repImg.Properties.ShowPopupShadow == false) { repImg.ShowPopup(); } } if (_tpBytes == null) { _tpDr["Icon"] = new byte[1]; } else { _tpDr["Icon"] = _tpBytes; } gv.RefreshRow(gv.FocusedRowHandle); repImg.ShowPopup(); } }
//Added By TBBC on 15 September 2015 private void gridViewMemberPackage_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { DataRow row = gridViewMemberPackage.GetDataRow(gridViewMemberPackage.FocusedRowHandle); if (row != null) { string selectedValueKey = System.Convert.ToString(row["PromoDis"]); if (selectedValueKey == "100%FULL") { string message = "You cannot upgrade package " + row["nPackageID"] + " first if you want to upgrade only one package! Please choose only 50% Discount Package first or both packages together!!!"; //You can upgrade only 50% Discount Package if you choose only one package! string caption = "Upgrading from existing package to new package"; MessageBoxButtons buttons = MessageBoxButtons.OK; DialogResult result; // Displays the MessageBox. result = MessageBox.Show(message, caption, buttons); if (result == System.Windows.Forms.DialogResult.OK) { } } } }
void overAllCon(DevExpress.XtraGrid.Views.Grid.GridView view) { int [] rows; List <DataRow> row = new List <DataRow> ( ); rows = view.GetSelectedRows( ); if (rows.Length <= 0) { return; } if (MessageBox.Show("确认已开?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } foreach (int i in rows) { row.Add(view.GetDataRow(i)); } if (row.Count > 0) { foreach (DataRow r in row) { _bll.UpdateOver(r); } } }
private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) { DevExpress.XtraGrid.Views.Grid.GridView gv = sender as DevExpress.XtraGrid.Views.Grid.GridView; DataRow row = gv.GetDataRow(e.RowHandle); switch (e.Column.FieldName) { case "SL": decimal d = ToolKit.ParseDecimal(e.CellValue); if (d.Equals(0m)) { e.DisplayText = string.Empty; } break; case "SSDWGC": if (row != null) { e.DisplayText = GetFiledValue(row["UnID"].ToString(), "Name").ToString(); } break; default: break; } }
private void BorrarFilasSeleccionadas(DevExpress.XtraGrid.Views.Grid.GridView view) { if (view == null || view.SelectedRowsCount == 0) { return; } DataRow[] rows = new DataRow[view.SelectedRowsCount]; for (int i = 0; i < view.SelectedRowsCount; i++) { rows[i] = view.GetDataRow(view.GetSelectedRows()[i]); } view.BeginSort(); try { foreach (DataRow row in rows) { row.Delete(); } } finally { view.EndSort(); } }
void gridView1_DoubleClick(object sender, EventArgs e) { DevExpress.XtraGrid.Views.Grid.GridView gv = sender as DevExpress.XtraGrid.Views.Grid.GridView; Point pt = gv.GridControl.PointToClient(MousePosition); DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo vi = gv.CalcHitInfo(pt); if (vi.InRowCell || vi.InRow) { var datarowitem = (BMS_DAL.DS.BMSDS.TVesselsRow)gv.GetDataRow(vi.RowHandle); datarowitem.OPER = BMS_Component.UserInfo.UserName; datarowitem.OP_DT = DateTime.Now; VesselItem item = new VesselItem(); item.Text = "Update Vessel"; item.DataRowItem = datarowitem; switch (item.ShowDialog()) { case DialogResult.OK: MessageBox.Show(string.Format("Update {0} rows", this._daservice.UpdateVessel(this._dt))); this._dt.Clear(); this._dt.Merge(_daservice.GetVessel()); this.BindData(); break; case DialogResult.Cancel: this._dt.RejectChanges(); break; } } }
private void simpleButtonOK_Click(object sender, System.EventArgs e) { DataRow r = gridView1.GetDataRow(gridView1.FocusedRowHandle); if (r != null) { if (myCategoryID == 1 || myCategoryID == 3 || myCategoryID == 4 || myCategoryID == 5 || myCategoryID == 6 || myCategoryID == 14 || myCategoryID == 23) { myPOS.NewReceiptEntry(r["strPackageCode"].ToString(), -1, r["strDescription"].ToString(), 1, ACMS.Convert.ToDecimal(r["mListPrice"]), ""); } else if (myCategoryID == 2) { if (lkpEdtBankCode.Text.Length == 0) { MessageBox.Show(this, "Please select a Bank Code"); this.DialogResult = DialogResult.None; return; } else if (lkpEdtBankBranchCode.Text.Length == 0) { MessageBox.Show(this, "Please select a Bank Branch Code"); this.DialogResult = DialogResult.None; return; } else if (txtEdtAccNo.Text.Length == 0) { MessageBox.Show(this, "Please key in the Account No"); this.DialogResult = DialogResult.None; return; } // myPOS.NewReceiptEntry(r["strPackageCode"].ToString(), // -1, r["strDescription"].ToString(), // 3, ACMS.Convert.ToDecimal(r["mListPrice"]), "", // lkpEdtBankCode.Text, lkpEdtBankBranchCode.Text, txtEdtAccNo.Text); } else if (myCategoryID == 7) { myPOS.NewReceiptEntry(r["strCreditPackageCode"].ToString(), -1, r["strDescription"].ToString(), 1, ACMS.Convert.ToDecimal(r["mListPrice"]), ""); } else if (myCategoryID == 8 || myCategoryID == 9) { myPOS.NewReceiptEntry(r["strPackageGroupCode"].ToString(), -1, r["strDescription"].ToString(), 1, ACMS.Convert.ToDecimal(r["mListPrice"]), ""); } else if (myCategoryID == 11 || myCategoryID == 12) { myPOS.NewReceiptEntry(r["strProductCode"].ToString(), -1, r["strDescription"].ToString(), 1, ACMS.Convert.ToDecimal(r["mBaseUnitPrice"]), ""); } } }
private void gridView1_MasterRowGetChildList(object sender, DevExpress.XtraGrid.Views.Grid.MasterRowGetChildListEventArgs e) { DataTable clone = customers.Clone(); DataRow row = gridView1.GetDataRow(e.RowHandle); clone.Rows.Add(row.ItemArray); e.ChildList = clone.DefaultView; }
private void opmiGridView_ShowingEditor(object sender, CancelEventArgs e) { DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView; if (view.FocusedRowHandle != DevExpress.XtraGrid.GridControl.NewItemRowHandle && view.GetDataRow(view.FocusedRowHandle).RowState != DataRowState.Added) { e.Cancel = true; } }
private void btnOk_Click(object sender, System.EventArgs e) { DataRow row = gvRoster.GetDataRow(gvRoster.FocusedRowHandle); ACMSDAL.TblRoster myRoster = new TblRoster(); myRoster.StrRemarks = row["strRemarks"].ToString(); myRoster.NRosterID = System.Convert.ToInt32(row["nRosterID"]); myRoster.Update2(); }
private void tsUp_Click(object sender, EventArgs e) { DevExpress.XtraGrid.Views.Grid.GridView view = DGvTransView; view.GridControl.Focus(); int index = view.FocusedRowHandle; if (index <= 0) { return; } DataRow row1 = view.GetDataRow(index); DataRow row2 = view.GetDataRow(index - 1); object val1 = row1[OrderFieldName]; object val2 = row2[OrderFieldName]; row1[OrderFieldName] = val2; row2[OrderFieldName] = val1; view.FocusedRowHandle = index - 1; }
DataRow[] GetGridSelectedRows() { int[] rowHandles = gridView1.GetSelectedRows(); DataRow[] rows = new DataRow[rowHandles.Length]; for (int i = 0; i < rowHandles.Length; i++) { rows[i] = gridView1.GetDataRow(rowHandles[i]); } return(rows); }