public void Clear() { txtName.Clear(); txtOrderID.Clear(); txtTeacher.Clear(); txtStudent.Clear(); oImprinting.ImprintItems.Clear(); txtProductID.Clear(); //ScannedItems.Items.Clear(); txtEntryDate.Text = DateTime.Now.Date.ToString(); Grid.DataBind(); }
/// <summary> /// 导出全部 /// </summary> public override void ExportAllAction(UltraGrid paramGrid, string paramGridName = "") { paramGridName = SystemTableEnums.Name.SM_CodeTable; List <CodeTableManagerUIModel> resultAllList = new List <CodeTableManagerUIModel>(); _bll.QueryForList(SQLID.BS_CodeTableManager_SQL01, new CodeTableManagerQCModel() { PageIndex = 1, PageSize = null, //类型 WHERE_CT_Type = cbWhere_CT_Type.Value?.ToString() ?? "", //参数名称 WHERE_CT_Name = txtWhere_CT_Name.Text.Trim(), //有效 WHERE_CT_IsValid = ckWhere_CT_IsValid.Checked, }, resultAllList); UltraGrid allGrid = gdGrid; allGrid.DataSource = resultAllList; allGrid.DataBind(); base.ExportAllAction(allGrid, paramGridName); gdGrid.DataSource = GridDS; gdGrid.DataBind(); }
/// <summary> /// 导出全部 /// </summary> public override void ExportAllAction(UltraGrid paramGrid, string paramGridName = "") { paramGridName = SystemTableEnums.Name.BS_AutoPartsName; List <AutoPartsNameManagerUIModel> resultAllList = new List <AutoPartsNameManagerUIModel>(); _bll.QueryForList <MDLBS_AutoPartsName, AutoPartsNameManagerUIModel>(new AutoPartsNameManagerQCModel() { PageIndex = 1, PageSize = null, //配件名称 WHERE_APN_Name = txtWhere_APN_Name.Text.Trim(), //配件别名 WHERE_APN_APT_ID = mcbWhere_APT_Name.SelectedValue, //有效 WHERE_APN_IsValid = ckWhere_APN_IsValid.Checked, }, resultAllList); UltraGrid allGrid = gdGrid; allGrid.DataSource = resultAllList; allGrid.DataBind(); base.ExportAllAction(allGrid, paramGridName); gdGrid.DataSource = GridDS; gdGrid.DataBind(); }
/// <summary> /// 导出全部 /// </summary> public override void ExportAllAction(UltraGrid paramGrid, string paramGridName = "") { paramGridName = SystemTableEnums.Name.BS_VehicleBrandInspireSumma; List <VehicleBrandInspireSummaManagerUIModel> resultAllList = new List <VehicleBrandInspireSummaManagerUIModel>(); _bll.QueryForList <MDLBS_VehicleBrandInspireSumma, VehicleBrandInspireSummaManagerUIModel>(new VehicleBrandInspireSummaManagerQCModel() { PageIndex = 1, PageSize = null, //品牌 WHERE_VBIS_Brand = mcbWhere_VBIS_Brand.SelectedValue, //车系 WHERE_VBIS_Inspire = mcbWhere_VBIS_Inspire.SelectedValue, //车辆类型 WHERE_VBIS_Model = cbWhere_VBIS_Model.Text, //车型描述 WHERE_VBIS_ModelDesc = mcbWhere_VBIS_ModelDesc.SelectedValue, }, resultAllList); UltraGrid allGrid = gdGrid; allGrid.DataSource = resultAllList; allGrid.DataBind(); base.ExportAllAction(allGrid, paramGridName); gdGrid.DataSource = GridDS; gdGrid.DataBind(); }
/// <summary> /// 导出全部 /// </summary> public override void ExportAllAction(UltraGrid paramGrid, string paramGridName = "") { paramGridName = SystemTableEnums.Name.EWM_Wallet; List <WalletQueryAndOperateUIModel> resultAllList = new List <WalletQueryAndOperateUIModel>(); _bll.QueryForList(SQLID.RIA_WalletQueryAndOperate_SQL01, new WalletQueryAndOperateQCModel() { PageIndex = 1, PageSize = null, //钱包账号 WHERE_Wal_No = txtWhere_Wal_No.Text.Trim(), //所有人类别 WHERE_Wal_OwnerTypeName = cbWhere_Wal_OwnerTypeName.Text.Trim(), //开户人 WHERE_Wal_CustomerName = txtWhere_Wal_CustomerName.Text.Trim(), //汽修商组织名称 WHERE_AutoFactoryName = mcbWhere_AutoFactoryName.SelectedText, //推荐员工 WHERE_Wal_RecommendEmployee = mcbWhere_Wal_RecommendEmployee.SelectedText, //手机号 WHERE_CustomerPhoneNo = txtWhere_CustomerPhoneNo.Text.Trim(), //组织 WHERE_Wal_Org_ID = cbWhere_Wal_Org_ID.Value?.ToString(), }, resultAllList); UltraGrid allGrid = gdGrid; allGrid.DataSource = resultAllList; allGrid.DataBind(); base.ExportAllAction(allGrid, paramGridName); gdGrid.DataSource = GridDS; gdGrid.DataBind(); }
private void btSave_Click(object sender, EventArgs e) { oCustomer.Kits.Save(oCustomer); bPrint_Click(null, null); Clear(); oCustomer.Kits.dtKits.Rows.Clear(); gKits.DataBind(); txtCustomerID.Focus(); }
/// <summary> /// 导出全部 /// </summary> public override void ExportAllAction(UltraGrid paramGrid, string paramGridName = "") { paramGridName = "钱包金额流水"; List <WalletTransLogQueryUIModel> resultAllList = new List <WalletTransLogQueryUIModel>(); _bll.QueryForList(SQLID.RIA_WalletTransLogQuery_SQL01, new WalletTransLogQueryQCModel() { PageIndex = 1, PageSize = null, //钱包账号 WHERE_WalT_Wal_No = txtWhere_WalT_Wal_No.Text.Trim(), //所有人类别 WHERE_Wal_OwnerTypeName = cbWhere_Wal_OwnerTypeName.Text.Trim(), //开户人 WHERE_Wal_CustomerName = txtWhere_Wal_CustomerName.Text.Trim(), //异动类型 WHERE_WalT_TypeName = cbWhere_WalT_TypeName.Text.Trim(), //充值方式 WHERE_WalT_RechargeTypeName = cbWhere_WalT_RechargeTypeName.Text.Trim(), //异动单号 WHERE_WalT_BillNo = txtWhere_WalT_BillNo.Text.Trim(), //开户人手机号 WHERE_CustomerPhoneNo = txtWhere_CustomerPhoneNo.Text.Trim(), //汽修商户 WHERE_AutoFactoryName = mcbWhere_AutoFactoryName.SelectedText, //受理组织 WHERE_WalT_Org_ID = cbWhere_WalT_Org_ID.Value?.ToString(), //备注 WHERE_WalT_Remark = txtWhere_WalT_Remark.Text.Trim(), }, resultAllList); UltraGrid allGrid = gdGrid; allGrid.DataSource = resultAllList; allGrid.DataBind(); base.ExportAllAction(allGrid, paramGridName); gdGrid.DataSource = GridDS; gdGrid.DataBind(); }
private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { #region txtPrizeID if (sender == txtPrizeID) { if (e.KeyCode == Keys.PageDown || e.KeyCode == Keys.F3) { return; } if (e.KeyCode.ToString() == "F2") { if (oPrize.View()) { ShowPrize(); txtDescription.Focus(); Grid.DataSource = oPrize.Items.dtItems; Grid.DataBind(); Grid.Focus(); MoveLast(); return; } } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtPrizeID.Text.Trim().Length == 0) { Clear(); txtPrizeID.Focus(); } if (oPrize.Find(txtPrizeID.Text)) { txtDescription.Text = oPrize.Description; Grid.DataSource = oPrize.Items.dtItems; Grid.DataBind(); Grid.Focus(); MoveLast(); } else { Clear(); oPrize.Items.dtItems.Rows.Clear(); oPrize.ID = txtPrizeID.Text; oPrize.Items.AddEmpty(); Grid.DataSource = oPrize.Items.dtItems; Grid.DataBind(); txtDescription.Focus(); } return; } } #endregion #region Grid if (sender == Grid) { if (e.KeyCode == Keys.F2) { UltraGridRow gridRow; gridRow = Grid.ActiveRow; if (gridRow != null) { if (Grid.ActiveRow.Cells["ProductID"] == Grid.ActiveCell) { if (oProduct.View()) { if (!oPrize.Items.Contains(Grid.ActiveRow.Cells["ProductID"].Text)) { Grid.ActiveRow.Cells["ProductID"].Value = oProduct.ID; Grid.ActiveRow.Cells["Description"].Value = oProduct.Description; Grid.ActiveRow.Cells["Amount"].Activate(); Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } else { MessageBox.Show("Item already entered"); Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } } } } } if (e.KeyCode == Keys.Delete) { } if (e.KeyCode == Keys.Enter) { Infragistics.Win.UltraWinGrid.UltraGridRow gridRow; gridRow = Grid.ActiveRow; if (gridRow != null) { if (Grid.ActiveRow.Cells["ProductID"] == Grid.ActiveCell) { if (oProduct.Find(Grid.ActiveRow.Cells["ProductID"].Text)) { if (!Contain(Grid.ActiveRow.Cells["ProductID"].Text)) { Grid.ActiveRow.Cells["ProductID"].Value = oProduct.ID; Grid.ActiveRow.Cells["Description"].Value = oProduct.Description; Grid.ActiveRow.Cells["BreakLevel"].Activate(); Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } else { MessageBox.Show("Item already entered"); Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } } return; } if (Grid.ActiveRow.Cells["Amount"] == Grid.ActiveCell) { gridRow = gridRow.GetSibling(Infragistics.Win.UltraWinGrid.SiblingRow.Next); if (gridRow != null) { MoveDown(); return; } else //if (Grid.ActiveRow.Cells["ProductID"].Text && Grid.ActiveRow.Cells["0"].Text) { if (Grid.ActiveRow.Cells["ProductID"].Text != "" && !Contain(Grid.ActiveRow.Cells["ProductID"].Text)) { if (Grid.GetRow(ChildRow.Last) == Grid.ActiveRow) { oPrize.Items.AddEmpty(); Grid.DataBind(); MoveLast(); //Grid.PerformAction(UltraGridAction.LastRowInBand, false, false); } else { Grid.PerformAction(UltraGridAction.NextRowByTab, false, false); Grid.ActiveRow.Cells["ProductID"].Activate(); Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } } else { Grid.ActiveRow.Cells["ProductID"].Activate(); Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); Grid.ActiveRow.Cells["BreakLevel"].Value = 0; Grid.ActiveRow.Cells["Amount"].Value = 0; } return; } } if (Grid.ActiveRow.Cells["BreakLevel"] == Grid.ActiveCell) { Grid.PerformAction(UltraGridAction.NextRowByTab, false, false); Grid.ActiveRow.Cells["Amount"].Activate(); Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); return; } if (Grid.ActiveRow.Cells["Quantity"] == Grid.ActiveCell) { Grid.PerformAction(UltraGridAction.NextRowByTab, false, false); Grid.ActiveRow.Cells["ProductID"].Activate(); Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); return; } } } if (e.KeyCode == Keys.Down) { MoveDown(); return; } if (e.KeyCode == Keys.Up) { Infragistics.Win.UltraWinGrid.UltraGridRow gridRow; gridRow = Grid.ActiveRow; gridRow = gridRow.GetSibling(Infragistics.Win.UltraWinGrid.SiblingRow.Previous); if (gridRow != null) { gridRow.Activate(); //' set ActiveCell Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); } return; } } #endregion #region txtDescription if (sender == txtDescription) { if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { oPrize.Description = txtDescription.Text; txtProductTypeID.Focus(); MoveLast(); return; } } #endregion #region txtProductTypeID if (sender == txtProductTypeID) { if (e.KeyCode.ToString() == "F2") { if (oPack.View()) { txtProductTypeID.Text = oPack.ID; txtPTDescription.Text = oPack.Description; } } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtProductTypeID.Text.Trim().Length == 0) { txtProductTypeID.Focus(); } if (oPack.Find(txtProductTypeID.Text)) { txtProductTypeID.Text = oPack.ID; txtPTDescription.Text = oPack.Description; } Grid.Focus(); return; } } #endregion #region Default Option //Default option switch (e.KeyCode) { case Keys.Tab: if (!e.Shift) { this.SelectNextControl(this.ActiveControl, true, true, true, true); } break; case Keys.Enter: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Down: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Up: this.SelectNextControl(this.ActiveControl, false, true, true, true); break; case Keys.F3: oPrize.Delete(); Clear(); oPrize.Items.dtItems.Rows.Clear(); Grid.DataBind(); txtPrizeID.Clear(); txtPrizeID.Focus(); break; case Keys.PageDown: this.Save(); //oPrize.Description = txtDescription.Text; //oPrize.Save(); Grid.DataBind(); Clear(); txtPrizeID.Clear(); txtPrizeID.Focus(); break; case Keys.Delete: if (e.Control) { DeleteItem(); } break; //case Keys.<some key>: // ......; // break; } #endregion }
/// <summary> /// 导出全部 /// </summary> public override void ExportAllAction(UltraGrid paramGrid, string paramGridName = "") { paramGridName = tabControlFull.Tabs[SysConst.EN_LIST].Selected ? "组织与组织资金往来统计汇总" : "组织与组织资金往来统计明细"; OrgAndOrgAmountTransReportQCModel tempConditionDS = new OrgAndOrgAmountTransReportQCModel() { //SqlId SqlId = tabControlFull.Tabs[SysConst.EN_LIST].Selected ? SQLID.RPT_OrgAndOrgAmountTransReport_SQL01 : SQLID.RPT_OrgAndOrgAmountTransReport_SQL02, PageIndex = 1, PageSize = null }; //源组织ID if (string.IsNullOrEmpty(mcbWhere_SourOrg.SelectedValue)) { var tmpOrgList = _orgList.Select(p => p.Org_ID).ToList(); if (tmpOrgList.Count > 0) { tempConditionDS.SourOrgIdList = string.Join(SysConst.Semicolon_DBC, tmpOrgList); } } else { tempConditionDS.SourOrgIdList = mcbWhere_SourOrg.SelectedValue; } //目的组织ID if (string.IsNullOrEmpty(mcbWhere_DestOrg.SelectedValue)) { var tmpOrgList = _orgList.Select(p => p.Org_ID).ToList(); if (tmpOrgList.Count > 0) { tempConditionDS.DestOrgIdList = string.Join(SysConst.Semicolon_DBC, tmpOrgList); } } else { tempConditionDS.DestOrgIdList = mcbWhere_DestOrg.SelectedValue; } if (this.dtWhere_CreatedTimeStart.Value != null) { //时间-开始 tempConditionDS.StartTime = this.dtWhere_CreatedTimeStart.DateTime; } if (this.dtWhere_CreatedTimeEnd.Value != null) { //时间-终了 tempConditionDS.EndTime = this.dtWhere_CreatedTimeEnd.DateTime; } if (tabControlFull.Tabs[SysConst.EN_LIST].Selected) { List <OrgAndOrgAmountTransTotalReportUIModel> resultAllList = new List <OrgAndOrgAmountTransTotalReportUIModel>(); _bll.QueryForList(SQLID.RPT_OrgAndOrgAmountTransReport_SQL01, tempConditionDS, resultAllList); //当前页合计 decimal totalAccountReceivableAmountOfCurPage = 0; decimal totalReceivedAmountOfCurPage = 0; decimal totalAccountPayableAmountOfCurPage = 0; decimal totalPaidAmountOfCurPage = 0; //合计 decimal totalAccountReceivableAmountOfAllPage = 0; decimal totalReceivedAmountOfAllPage = 0; decimal totalAccountPayableAmountOfAllPage = 0; decimal totalPaidAmountOfAllPage = 0; foreach (var loopItem in resultAllList) { totalAccountReceivableAmountOfCurPage += (loopItem.ARB_AccountReceivableAmount ?? 0); totalReceivedAmountOfCurPage += (loopItem.ARB_ReceivedAmount ?? 0); totalAccountPayableAmountOfCurPage += (loopItem.APB_AccountPayableAmount ?? 0); totalPaidAmountOfCurPage += (loopItem.APB_PaidAmount ?? 0); } OrgAndOrgAmountTransTotalReportUIModel curPageTotal = new OrgAndOrgAmountTransTotalReportUIModel { DestOrgName = _sumCurPageDesc, ARB_AccountReceivableAmount = Math.Round(totalAccountReceivableAmountOfCurPage, 2), ARB_ReceivedAmount = Math.Round(totalReceivedAmountOfCurPage, 2), APB_AccountPayableAmount = Math.Round(totalAccountPayableAmountOfCurPage, 2), APB_PaidAmount = Math.Round(totalPaidAmountOfCurPage, 2) }; resultAllList.Add(curPageTotal); if (resultAllList.Count > 0) { OrgAndOrgAmountTransTotalReportUIModel subObject = _orgAndOrgAmountTransTotalReportDs[0]; TotalRecordCountOfTotal = subObject.RecordCount ?? 0; totalAccountReceivableAmountOfAllPage = (subObject.TotalAccountReceivableAmount ?? 0); totalReceivedAmountOfAllPage = (subObject.TotalReceivedAmount ?? 0); totalAccountPayableAmountOfAllPage = (subObject.TotalAccountPayableAmount ?? 0); totalPaidAmountOfAllPage = (subObject.TotalPaidAmount ?? 0); } OrgAndOrgAmountTransTotalReportUIModel allPageTotal = new OrgAndOrgAmountTransTotalReportUIModel { DestOrgName = _sumAllPageDesc, ARB_AccountReceivableAmount = Math.Round(totalAccountReceivableAmountOfAllPage, 2), ARB_ReceivedAmount = Math.Round(totalReceivedAmountOfAllPage, 2), APB_AccountPayableAmount = Math.Round(totalAccountPayableAmountOfAllPage, 2), APB_PaidAmount = Math.Round(totalPaidAmountOfAllPage, 2) }; resultAllList.Add(allPageTotal); UltraGrid allGrid = OrgAndOrgAmountTransReportGrid; allGrid.DataSource = resultAllList; allGrid.DataBind(); base.ExportAllAction(allGrid, paramGridName); OrgAndOrgAmountTransReportGrid.DataSource = _orgAndOrgAmountTransTotalReportDs; OrgAndOrgAmountTransReportGrid.DataBind(); } else { List <OrgAndOrgAmountTransDetailReportUIModel> resultAllList = new List <OrgAndOrgAmountTransDetailReportUIModel>(); _bll.QueryForList(SQLID.RPT_OrgAndOrgAmountTransReport_SQL02, tempConditionDS, resultAllList); //当前页合计 decimal totalQtyOfCurPage = 0; decimal totalAmountOfCurPage = 0; //合计 decimal totalQtyOfAllPage = 0; decimal totalAmountOfAllPage = 0; foreach (var loopDetail in resultAllList) { totalQtyOfCurPage += (loopDetail.TBD_Qty ?? 0); totalAmountOfCurPage += (loopDetail.TransferAmount ?? 0); } OrgAndOrgAmountTransDetailReportUIModel curPageTotal = new OrgAndOrgAmountTransDetailReportUIModel { TBD_Specification = _sumCurPageDesc, TBD_Qty = Math.Round(totalQtyOfCurPage, 2), TransferAmount = Math.Round(totalAmountOfCurPage, 2), }; resultAllList.Add(curPageTotal); if (resultAllList.Count > 0) { OrgAndOrgAmountTransDetailReportUIModel subObject = resultAllList[0]; TotalRecordCountOfDetail = (subObject.RecordCount ?? 0); totalQtyOfAllPage = (subObject.TotalQty ?? 0); totalAmountOfAllPage = (subObject.TotalAmount ?? 0); } else { TotalRecordCountOfDetail = 0; } OrgAndOrgAmountTransDetailReportUIModel allPageTotal = new OrgAndOrgAmountTransDetailReportUIModel { TBD_Specification = _sumAllPageDesc, TBD_Qty = Math.Round(totalQtyOfAllPage, 2), TransferAmount = Math.Round(totalAmountOfAllPage, 2), }; resultAllList.Add(allPageTotal); UltraGrid allGrid = OrgAndOrgAmountTransDetailGrid; allGrid.DataSource = resultAllList; allGrid.DataBind(); base.ExportAllAction(allGrid, paramGridName); OrgAndOrgAmountTransDetailGrid.DataSource = _orgAndOrgAmountTransDetailReportDs; OrgAndOrgAmountTransDetailGrid.DataBind(); } }
/// <summary> /// 导出全部 /// </summary> public override void ExportAllAction(UltraGrid paramGrid, string paramGridName = "") { paramGridName = tabControlFull.Tabs[SysConst.EN_LIST].Selected ? "组织与客户资金往来统计汇总" : "组织与客户资金往来统计明细"; OrgAndCustomerAmountTransReportQCModel tempConditionDS = new OrgAndCustomerAmountTransReportQCModel() { //SqlId SqlId = tabControlFull.Tabs[SysConst.EN_LIST].Selected ? SQLID.RPT_OrgAndCustomerAmountTransReport_SQL01 : SQLID.RPT_OrgAndCustomerAmountTransReport_SQL02, //客户ID CustomerID = this.mcbWhere_Client_Name.SelectedValue, PageIndex = 1, PageSize = null }; //组织ID if (string.IsNullOrEmpty(mcbWhere_Sales_Org.SelectedValue)) { var tmpOrgList = _orgList.Select(p => p.Org_ID).ToList(); if (tmpOrgList.Count > 0) { ConditionDS.OrgIdList = string.Join(SysConst.Semicolon_DBC, tmpOrgList); } } else { ConditionDS.OrgIdList = mcbWhere_Sales_Org.SelectedValue; } if (this.dtWhere_Sales_TimeStart.Value != null) { //销售时间-开始 tempConditionDS.StartTime = this.dtWhere_Sales_TimeStart.DateTime; } if (this.dtWhere_Sales_TimeEnd.Value != null) { //销售时间-终了 tempConditionDS.EndTime = this.dtWhere_Sales_TimeEnd.DateTime; } if (tabControlFull.Tabs[SysConst.EN_LIST].Selected) { List <OrgAndCustomerAmountTransTotalReportUIModel> resultAllList = new List <OrgAndCustomerAmountTransTotalReportUIModel>(); _bll.QueryForList(SQLID.RPT_OrgAndCustomerAmountTransReport_SQL01, tempConditionDS, resultAllList); decimal totalAccountPayableAmountOfCurPage = 0; decimal totalPaidAmountOfCurPage = 0; decimal totalAccountPayableAmountOfAllPage = 0; decimal totalPaidAmountOfAllPage = 0; if (resultAllList.Count > 0) { OrgAndCustomerAmountTransTotalReportUIModel subObject = resultAllList[0]; totalAccountPayableAmountOfAllPage = (subObject.TotalAccountReceivableAmount ?? 0); totalPaidAmountOfAllPage = (subObject.TotalReceivedAmount ?? 0); } foreach (var loopSotckInTotalItem in resultAllList) { totalAccountPayableAmountOfCurPage += (loopSotckInTotalItem.ARB_AccountReceivableAmount ?? 0); totalPaidAmountOfCurPage += (loopSotckInTotalItem.ARB_ReceivedAmount ?? 0); } OrgAndCustomerAmountTransTotalReportUIModel curPageTotal = new OrgAndCustomerAmountTransTotalReportUIModel { CustomerName = _sumCurPageDesc, ARB_AccountReceivableAmount = Math.Round(totalAccountPayableAmountOfCurPage, 2), ARB_ReceivedAmount = Math.Round(totalPaidAmountOfCurPage, 2) }; resultAllList.Add(curPageTotal); OrgAndCustomerAmountTransTotalReportUIModel allPageTotal = new OrgAndCustomerAmountTransTotalReportUIModel { CustomerName = _sumAllPageDesc, ARB_AccountReceivableAmount = Math.Round(totalAccountPayableAmountOfAllPage, 2), ARB_ReceivedAmount = Math.Round(totalPaidAmountOfAllPage, 2) }; resultAllList.Add(allPageTotal); UltraGrid allGrid = OrgAndCustomerAmountTransReportGrid; allGrid.DataSource = resultAllList; allGrid.DataBind(); base.ExportAllAction(allGrid, paramGridName); OrgAndCustomerAmountTransReportGrid.DataSource = _orgAndCustomerAmountTransTotalReportDS; OrgAndCustomerAmountTransReportGrid.DataBind(); } else { List <OrgAndCustomerAmountTransDetailReportUIModel> resultAllList = new List <OrgAndCustomerAmountTransDetailReportUIModel>(); _bll.QueryForList(SQLID.RPT_OrgAndCustomerAmountTransReport_SQL02, tempConditionDS, resultAllList); decimal totalAutoPartsQtyOfCurPage = 0; decimal totalAutoPartsAmountOfCurPage = 0; decimal totalAutoPartsQtyOfAllPage = 0; decimal totalAutoPartsAmountOfAllPage = 0; if (resultAllList.Count > 0) { OrgAndCustomerAmountTransDetailReportUIModel subObject = resultAllList[0]; TotalRecordCountOfDetail = (subObject.RecordCount ?? 0); totalAutoPartsQtyOfAllPage = (subObject.TotalAutoPartsQty ?? 0); totalAutoPartsAmountOfAllPage = (subObject.TotalAutoPartsAmount ?? 0); } else { TotalRecordCountOfDetail = 0; } foreach (var loopSotckInDetailItem in resultAllList) { totalAutoPartsQtyOfCurPage += (loopSotckInDetailItem.AutoPartsQty ?? 0); totalAutoPartsAmountOfCurPage += (loopSotckInDetailItem.AutoPartsAmount ?? 0); } OrgAndCustomerAmountTransDetailReportUIModel curPageTotal = new OrgAndCustomerAmountTransDetailReportUIModel { APA_Specification = _sumCurPageDesc, AutoPartsQty = Math.Round(totalAutoPartsQtyOfCurPage, 0), AutoPartsAmount = Math.Round(totalAutoPartsAmountOfCurPage, 2) }; resultAllList.Add(curPageTotal); OrgAndCustomerAmountTransDetailReportUIModel allPageTotal = new OrgAndCustomerAmountTransDetailReportUIModel { APA_Specification = _sumAllPageDesc, AutoPartsQty = Math.Round(totalAutoPartsQtyOfAllPage, 0), AutoPartsAmount = Math.Round(totalAutoPartsAmountOfAllPage, 2) }; resultAllList.Add(allPageTotal); UltraGrid allGrid = OrgAndCustomerAmountTransDetailGrid; allGrid.DataSource = resultAllList; allGrid.DataBind(); base.ExportAllAction(allGrid, paramGridName); OrgAndCustomerAmountTransDetailGrid.DataSource = _orgAndCustomerAmountTransDetailReportDS; OrgAndCustomerAmountTransDetailGrid.DataBind(); } }
private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { #region txtBrochureID if (sender == txtBrochureID) { if (e.KeyCode == Keys.PageDown || e.KeyCode == Keys.F3) { return; } if (e.KeyCode.ToString() == "F2") { if (oBrochure.View()) { ShowVendor(); } if (txtBrochureID.Text == "") { return; } txtDescription.Focus(); Grid.DataSource = oBrochure.Items.dtItems; Grid.DataBind(); Grid.Focus(); MoveLast(); return; } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtBrochureID.Text.Trim().Length == 0) { Clear(); txtBrochureID.Focus(); } if (oBrochure.Find(txtBrochureID.Text)) { ShowVendor(); Grid.DataSource = oBrochure.Items.dtItems; Grid.DataBind(); Grid.Focus(); MoveLast(); } else { Clear(); oBrochure.ID = txtBrochureID.Text; oBrochure.Items.AddEmpty(); Grid.DataSource = oBrochure.Items.dtItems; Grid.DataBind(); txtDescription.Focus(); } return; } } #endregion #region txtDescription if (sender == txtDescription) { if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { oBrochure.Description = txtDescription.Text; Grid.Focus(); MoveLast(); return; } } #endregion #region Grid if (sender == Grid) { if (e.KeyCode == Keys.F2) { UltraGridRow gridRow; gridRow = Grid.ActiveRow; if (gridRow != null) { if (Grid.ActiveRow.Cells["ProductID"] == Grid.ActiveCell) { if (oProduct.View()) { if (!Contain(Grid.ActiveRow.Cells["ProductID"].Text)) { Grid.ActiveRow.Cells["ProductID"].Value = oProduct.ID; Grid.ActiveRow.Cells["InvCode"].Value = oProduct.InvCode; Grid.ActiveRow.Cells["Description"].Value = oProduct.Description; Grid.ActiveRow.Cells["Price"].Activate(); Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } else { MessageBox.Show("Item already entered"); Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } } } } } if (e.KeyCode == Keys.Delete) { } if (e.KeyCode == Keys.Enter) { if (Grid.ActiveRow.Cells["ProductID"].Text != "" && !Contain(Grid.ActiveRow.Cells["ProductID"].Text)) { if (Grid.ActiveRow.Cells["ProductID"] == Grid.ActiveCell) { if (oProduct.Find(Grid.ActiveRow.Cells["ProductID"].Text)) { if (!Contain(Grid.ActiveRow.Cells["ProductID"].Text)) { Grid.ActiveRow.Cells["ProductID"].Value = oProduct.ID; Grid.ActiveRow.Cells["InvCode"].Value = oProduct.InvCode; Grid.ActiveRow.Cells["Description"].Value = oProduct.Description; Grid.ActiveRow.Cells["Price"].Activate(); Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } else { MessageBox.Show("Item already entered"); Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } } } else if (Grid.ActiveRow.Cells["Price"] == Grid.ActiveCell) { Grid.ActiveRow.Cells["Forecast"].Activate(); Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } if (Grid.GetRow(ChildRow.Last) == Grid.ActiveRow) { oBrochure.Items.AddEmpty(); Grid.DataBind(); MoveLast(); //Grid.PerformAction(UltraGridAction.LastRowInBand, false, false); } else { Grid.PerformAction(UltraGridAction.NextRowByTab, false, false); Grid.ActiveRow.Cells["ProductID"].Activate(); Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } } else { Grid.ActiveRow.Cells["ProductID"].Activate(); Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); Grid.ActiveRow.Cells["Price"].Value = 0; } return; } if (e.KeyCode == Keys.Down) { MoveDown(); return; } if (e.KeyCode == Keys.Up) { Infragistics.Win.UltraWinGrid.UltraGridRow gridRow; gridRow = Grid.ActiveRow; gridRow = gridRow.GetSibling(Infragistics.Win.UltraWinGrid.SiblingRow.Previous); if (gridRow != null) { gridRow.Activate(); //' set ActiveCell Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); } return; //SendKeys.Send("{TAB}"); } } #endregion #region txtProductID if (sender == txtProductID) { if (e.KeyCode.ToString() == "F2") { if (oProduct.View()) { txtProductID.Text = oProduct.ID; txtPDescription.Text = oProduct.Description; } } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtProductID.Text.Trim().Length == 0) { txtProductID.Focus(); } if (oProduct.Find(txtProductID.Text)) { txtProductID.Text = oProduct.ID; txtPDescription.Text = oProduct.Description; } } } #endregion #region txtProductTypeID if (sender == txtProductTypeID) { if (e.KeyCode.ToString() == "F2") { if (oPack.View()) { txtProductTypeID.Text = oPack.ID; txtPTDescription.Text = oPack.Description; } } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtProductTypeID.Text.Trim().Length == 0) { txtProductTypeID.Focus(); } if (oPack.Find(txtProductTypeID.Text)) { txtProductTypeID.Text = oPack.ID; txtPTDescription.Text = oPack.Description; } } } #endregion #region Default Option //Default option switch (e.KeyCode) { case Keys.Tab: if (!e.Shift) { this.SelectNextControl(this.ActiveControl, true, true, true, true); } break; case Keys.Enter: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Down: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Up: this.SelectNextControl(this.ActiveControl, false, true, true, true); break; case Keys.F3: if (MessageBox.Show("Do you really want to Delete this Brochure?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { MessageBox.Show("Operation Cancelled"); return; } oBrochure.Delete(); Grid.DataBind(); Clear(); txtBrochureID.Clear(); txtBrochureID.Focus(); break; case Keys.PageDown: this.Save(); Grid.DataBind(); Clear(); txtBrochureID.Clear(); txtBrochureID.Focus(); break; case Keys.Delete: if (e.Control) { DeleteItem(); } break; //case Keys.<some key>: // ......; // break; } #endregion }
private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { #region txtOrderID if (sender == txtOrderID) { if (e.KeyCode.ToString() == "Return" || e.KeyCode.ToString() == "Tab") { if (txtOrderID.Text.Trim() == "") { txtOrderID.Clear(); txtOrderID.Focus(); return; } if (oOrder.Find(Convert.ToInt32(txtOrderID.Text))) { if (CompanyID != oOrder.CompanyID) { MessageBox.Show("Different Order's Company/Season"); txtOrderID.Clear(); txtOrderID.Focus(); return; } txtTeacher.Text = oOrder.Teacher; txtStudent.Text = oOrder.Student; this.ShowOrder(Convert.ToInt32(txtOrderID.Text)); if (oOrder.Packed) { MessageBox.Show("Order already packed " + oOrder.BoxesPacked.ToString() + " boxes"); txtBoxes.Enabled = true; txtBoxes.Text = oOrder.BoxesPacked.ToString(); txtBoxes.Focus(); /* Clear(); * txtOrderID.Clear(); * txtOrderID.Focus();*/ return; } txtOrderID.Enabled = false; txtBoxes.Enabled = false; txtProductID.Focus(); return; } else { MessageBox.Show("Order not found..."); txtOrderID.Clear(); txtOrderID.Focus(); return; } } } #endregion #region txtProductID if (sender == txtProductID) { if (e.KeyCode.ToString() == "F8") { this.Grid.Focus(); } if (e.KeyCode.ToString() == "F2") { if (oOrder.oProduct.View()) { this.txtProductID.Text = oOrder.oProduct.ID; return; } } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { txtDescription.Clear(); if (txtProductID.Text.ToUpper() == "DONE") { if (!oOrder.IfDone()) { Global.playSimpleSound(1); txtDescription.Text = "You have products left"; ActiveLeft(); txtProductID.Clear(); txtProductID.Focus(); return; } txtBoxes.Clear(); txtBoxes.Enabled = true; txtBoxes.Focus(); //txtOrderID.Enabled = true; return; } if (txtProductID.Text.ToUpper() == "ABORT") { Clear(); groupBox2.Focus(); txtOrderID.Enabled = true; txtOrderID.Focus(); return; } BarCode_2: if (txtProductID.Text.Length < 12) { txtProductID.Text = oOrder.GetItem(txtProductID.Text); if (txtProductID.Text == "") { Global.playSimpleSound(2); txtDescription.Text = "PRODUCT NOT IN ORDER"; this.txtProductID.Clear(); this.txtProductID.Focus(); return; } } //Check by Code if (oOrder.ScanItems.Contains(txtProductID.Text)) { if (oOrder.ScanItems[txtProductID.Text].Quantity < (oOrder.ScanItems[txtProductID.Text].Scanned + 1)) { Global.playSimpleSound(3); txtDescription.Text = "EXTRA PRODUCT !!!"; txtProductID.Clear(); return; } oOrder.ScanItems[txtProductID.Text].Scanned += 1; //if (oOrder.ScanItems[txtProductID.Text].Scanned == oOrder.ScanItems[txtProductID.Text].Quantity) // DeleteRow(); this.txtDescription.Text = oOrder.ScanItems[txtProductID.Text].Description; //this.ScannedItems.Text = oOrder.ScanItems[txtProductID.Text].ProductID + " - " + oOrder.ScanItems[txtProductID.Text].Description; //this.ScannedItems.Items.Add(oOrder.ScanItems[txtProductID.Text].ProductID + " - " + oOrder.ScanItems[txtProductID.Text].Description); if (oOrder.ScanItems[txtProductID.Text].Scanned == oOrder.ScanItems[txtProductID.Text].Quantity) { //oOrder.ScanItems[txtProductID.Text].Packed = ""; this.ActiveRow(true); } else { this.ActiveRow(false); } Grid.DataBind(); this.txtProductID.Clear(); //this.txtDescription.Text = ""; // return; } else { String Barcode2 = oOrder.GetSecondaryBarcode(txtProductID.Text); if (Barcode2 != "") { txtProductID.Text = Barcode2; goto BarCode_2; } Global.playSimpleSound(5); txtDescription.Text = "PRODUCT NOT IN ORDER"; this.txtProductID.Clear(); this.txtProductID.Focus(); return; } } } #endregion #region txtBoxes if (sender == txtBoxes) { if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtBoxes.Text == "") { txtBoxes.Focus(); return; } if (txtBoxes.Text.ToUpper() == "DONE" || txtBoxes.Text.ToUpper() == "ONE") { txtBoxes.Text = "1"; } oOrder.BoxesPacked = Convert.ToInt16(txtBoxes.Text); oOrder.UpdatePacked(true); Clear(); txtBoxes.Enabled = false; txtOrderID.Enabled = true; txtOrderID.Focus(); return; } } #endregion #region txtGrid if (sender == this.Grid) { if (e.KeyCode.ToString() == "F8") { this.txtProductID.Focus(); return; } if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Up || e.KeyCode == Keys.Down || e.KeyCode == Keys.PageDown) { //return; } } #endregion #region Default Option //Default option switch (e.KeyCode) { case Keys.Tab: if (!e.Shift) { this.SelectNextControl(this.ActiveControl, true, true, true, true); } break; case Keys.Enter: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Down: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Up: this.SelectNextControl(this.ActiveControl, false, true, true, true); break; case Keys.F8: this.Grid.Focus(); break; case Keys.F3: break; case Keys.PageDown: break; //case Keys.<some key>: // ......; // break; } #endregion }
private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { #region txtCustomerID if (sender == txtCustomerID) { if (e.KeyCode == Keys.PageDown || e.KeyCode == Keys.F3) { return; } if (e.KeyCode.ToString() == "F2") { if (oCustomer.View()) { ShowCustomer(); oTeachers.CustomerID = oCustomer.ID; oTeachers.Load(oCustomer.ID); Grid.DataSource = oTeachers.Table; Grid.DataBind(); Grid.Focus(); MoveLast(); return; } } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtCustomerID.Text.Trim().Length == 0) { Clear(); txtCustomerID.Focus(); } if (oCustomer.Find(txtCustomerID.Text)) { ShowCustomer(); oTeachers.CustomerID = oCustomer.ID; oTeachers.Load(oCustomer.ID); Grid.DataSource = oTeachers.Table; Grid.DataBind(); Grid.Focus(); MoveLast(); } else { Clear(); Grid.DataSource = oTeachers.Table; Grid.DataBind(); txtName.Focus(); } return; } } #endregion #region Grid if (sender == Grid) { if (e.KeyCode == Keys.F2) { UltraGridRow gridRow; gridRow = Grid.ActiveRow; if (gridRow != null) { if (Grid.ActiveRow.Cells["Teacher"] == Grid.ActiveCell) { /* * if (oProduct.View()) * { * if (!oImages.Items.Contains(Grid.ActiveRow.Cells["ProductID"].Text)) * { * * Grid.ActiveRow.Cells["ProductID"].Value = oProduct.ID; * Grid.ActiveRow.Cells["Description"].Value = oProduct.Description; * Grid.ActiveRow.Cells["Amount"].Activate(); * Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); * return; * } * else * { * MessageBox.Show("Item already entered"); * Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; * Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); * return; * } * } */ } } } if (e.KeyCode == Keys.Delete) { } if (e.KeyCode == Keys.Enter) { Infragistics.Win.UltraWinGrid.UltraGridRow gridRow; gridRow = Grid.ActiveRow; if (gridRow != null) { if (Grid.ActiveCell.Text.Trim() != "" && Grid.ActiveRow.Cells["Teacher"] == Grid.ActiveCell) { if (Contain(Grid.ActiveRow.Cells["Teacher"].Text)) { MessageBox.Show("Item already entered"); Grid.ActiveCell = Grid.ActiveRow.Cells["Teacher"]; Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); Grid.ActiveRow.Cells["Teacher"].Value = ""; } else { this.MoveLast(); } } return; } } if (e.KeyCode == Keys.Down) { MoveDown(); return; } if (e.KeyCode == Keys.Up) { Infragistics.Win.UltraWinGrid.UltraGridRow gridRow; gridRow = Grid.ActiveRow; gridRow = gridRow.GetSibling(Infragistics.Win.UltraWinGrid.SiblingRow.Previous); if (gridRow != null) { gridRow.Activate(); //' set ActiveCell Grid.ActiveCell = Grid.ActiveRow.Cells["Teacher"]; Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); } return; } } #endregion #region txtName if (sender == txtName) { if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { // oImages.Description = txtName.Text; Grid.Focus(); MoveLast(); return; } } #endregion #region Default Option //Default option switch (e.KeyCode) { case Keys.Tab: if (!e.Shift) { this.SelectNextControl(this.ActiveControl, true, true, true, true); } break; case Keys.Enter: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Down: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Up: this.SelectNextControl(this.ActiveControl, false, true, true, true); break; case Keys.F3: oTeachers.Delete(); Clear(); // oImages.Items.dtItems.Rows.Clear(); Grid.DataBind(); txtCustomerID.Clear(); txtCustomerID.Focus(); break; case Keys.PageDown: MoveLast(); oTeachers.Save(); Grid.DataBind(); Clear(); txtCustomerID.Clear(); txtCustomerID.Focus(); break; case Keys.Delete: if (e.Control) { DeleteItem(); } break; //case Keys.<some key>: // ......; // break; } #endregion }
private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { //MessageBox.Show(e.KeyCode.ToString()); #region Grid if (sender == Grid) { if (Grid.ActiveRow != null) { if (e.KeyCode == Keys.Delete) { if (e.Shift && Grid.GetRow(ChildRow.Last) != Grid.ActiveRow) { Grid.ActiveRow.Delete(); MoveLast(); return; } } switch (Grid.ActiveCell.Column.Key) { case "ProductID": { if (e.KeyCode == Keys.F2) { if (oProduct.View()) { Grid.ActiveRow.Cells["ProductID"].Value = oProduct.ID; Grid.ActiveRow.Cells["Description"].Value = oProduct.Description; Grid.ActiveRow.Cells["Price"].Value = oProduct.Price; Grid.ActiveRow.Cells["Quantity"].Value = 1; Grid.ActiveRow.Cells["Quantity"].Activate(); Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } } if (e.KeyCode == Keys.Return) { if (!Contain(Grid.ActiveRow.Cells["ProductID"].Text)) //(!oProduct.Items.Contains(Grid.ActiveRow.Cells["ProductID"].Text)) { if (oProduct.Find(Grid.ActiveRow.Cells["ProductID"].Text)) { Grid.ActiveRow.Cells["ProductID"].Value = oProduct.ID; Grid.ActiveRow.Cells["Description"].Value = oProduct.Description; Grid.ActiveRow.Cells["Price"].Value = oProduct.Cost; Grid.ActiveRow.Cells["Quantity"].Value = 1; Grid.ActiveRow.Cells["Quantity"].Activate(); Grid.ActiveCell = Grid.ActiveRow.Cells["Quantity"]; Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } } else { MessageBox.Show("Item already entered"); Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } } if (e.KeyCode == Keys.Down) { Grid.PerformAction(UltraGridAction.NextRowByTab, false, false); Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } if (e.KeyCode == Keys.Up) { Grid.PerformAction(UltraGridAction.PrevRowByTab, false, false); Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } if (e.KeyCode == Keys.Right) { Grid.PerformAction(UltraGridAction.NextCellByTab, false, false); Grid.ActiveCell = Grid.ActiveRow.Cells["Cases"]; Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } } break; case "Quantity": if (e.KeyCode == Keys.Return) { if (Grid.ActiveRow.Cells["ProductID"].Text != "" && !Contain(Grid.ActiveRow.Cells["ProductID"].Text)) { if (Grid.GetRow(ChildRow.Last) == Grid.ActiveRow) { oProduct.Items.AddEmpty(); Grid.DataBind(); MoveLast(); //Grid.PerformAction(UltraGridAction.LastRowInBand, false, false); } else { Grid.PerformAction(UltraGridAction.NextRowByTab, false, false); Grid.ActiveRow.Cells["ProductID"].Activate(); Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } } else { Grid.ActiveRow.Cells["ProductID"].Activate(); Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); Grid.ActiveRow.Cells["Quantity"].Value = 1; } return; } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Down || e.KeyCode == Keys.Tab) { Grid.PerformAction(UltraGridAction.NextRowByTab, false, false); Grid.ActiveCell = Grid.ActiveRow.Cells["Quantity"]; Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } if (e.KeyCode == Keys.Up) { Grid.PerformAction(UltraGridAction.PrevRowByTab, false, false); Grid.ActiveCell = Grid.ActiveRow.Cells["Quantity"]; Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } break; default: { if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Down || e.KeyCode == Keys.Tab) { Grid.PerformAction(UltraGridAction.NextRowByTab, false, false); //Grid.ActiveCell = Grid.ActiveRow.Cells["Received"]; Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } if (e.KeyCode == Keys.Up) { Grid.PerformAction(UltraGridAction.PrevRowByTab, false, false); //Grid.ActiveCell = Grid.ActiveRow.Cells["Received"]; Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } } break; } } return; } #endregion #region txtOrderID if (sender == txtProductID) { if (e.KeyCode == Keys.F2) { if (oProduct.View()) { txtProductID.Text = oProduct.ID; // txtVendorID.Text = oProduct.VendID; // oVendor.Find(oProduct.VendID); // txtName.Text = oVendor.Name; Grid.DataSource = oProduct.Items.dtItems; //oProduct.Items; Grid.DataBind(); MoveLast(); txtProductID.Enabled = false; return; } else { Grid.Height = 529; } //this.txtDescription.Text = return; } if (e.KeyCode.ToString() == "Return" || e.KeyCode.ToString() == "Tab") { if (txtProductID.Text.Trim() == "") { txtProductID.Clear(); txtProductID.Focus(); return; } if (oProduct.Find(txtProductID.Text)) { // txtVendorID.Text = oProduct.VendID; // oVendor.Find(oProduct.VendID); // txtName.Text = oVendor.Name; //Grid.DataSource = oProduct.Items; Grid.DataSource = oProduct.Items.dtItems; //oProduct.Items; MoveLast(); txtProductID.Enabled = false; return; } else { return; } } } #endregion #region Default Option //Default option switch (e.KeyCode) { case Keys.Tab: if (!e.Shift) { this.SelectNextControl(this.ActiveControl, true, true, true, true); } break; case Keys.Enter: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Down: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Up: this.SelectNextControl(this.ActiveControl, false, true, true, true); break; case Keys.F3: deleteOrder(); break; case Keys.PageDown: break; case Keys.Delete: if (!e.Control) { Grid.ActiveRow.Delete(); } break; //case Keys.<some key>: // ......; // break; } #endregion }
private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { #region txtAccountID if (sender == txtAccountID) { if (e.KeyCode == Keys.PageDown || e.KeyCode == Keys.F3) { return; } if (e.KeyCode.ToString() == "F2") { if (oeMail.View(this.DomainID)) { txtAccountID.Text = oeMail.User; ShowVendor(); } if (txtAccountID.Text == "") { return; } txtDescription.Focus(); Grid.DataSource = oeMail.Items.dt; Grid.DataBind(); Grid.Focus(); oeMail.Items.AddEmpty(); MoveLast(); return; } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtAccountID.Text.Trim().Length == 0) { Clear(); txtAccountID.Focus(); } if (oeMail.Find(txtAccountID.Text)) { txtAccountID.Text = oeMail.User; ShowVendor(); Grid.DataSource = oeMail.Items.dt; Grid.DataBind(); Grid.Focus(); oeMail.Items.AddEmpty(); MoveLast(); } else { Clear(); oeMail.Items.AddEmpty(); Grid.DataSource = oeMail.Items.dt; Grid.DataBind(); txtPassword.Focus(); } return; } } #endregion #region txtDescription if (sender == txtDescription) { if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { //oeMail..Description = txtDescription.Text; Grid.Focus(); MoveLast(); return; } } #endregion #region Grid if (sender == Grid) { if (e.KeyCode == Keys.F2) { UltraGridRow gridRow; gridRow = Grid.ActiveRow; if (gridRow != null) { if (Grid.ActiveRow.Cells["destination"] == Grid.ActiveCell) {/* * if (oRep.View()) * { * if (!Contain(Grid.ActiveRow.Cells["ProductID"].Text)) * { * * Grid.ActiveRow.Cells["ProductID"].Value = oRep.ID; * Grid.ActiveRow.Cells["InvCode"].Value = oRep.InvCode; * Grid.ActiveRow.Cells["Description"].Value = oRep.Description; * Grid.ActiveRow.Cells["Price"].Activate(); * Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); * return; * } * else * { * MessageBox.Show("Item already entered"); * Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; * Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); * return; * } * } */ } } } if (e.KeyCode == Keys.Delete) { } if (e.KeyCode == Keys.Enter) { if (Grid.ActiveRow != null) { if (Grid.ActiveRow.Cells["destination"].Text != "" && !Contain(Grid.ActiveRow.Cells["destination"].Text)) { if (Grid.ActiveRow.Cells["destination"] == Grid.ActiveCell) {/* * if (oRep.Find(Grid.ActiveRow.Cells["ProductID"].Text)) * { * if (!Contain(Grid.ActiveRow.Cells["ProductID"].Text)) * { * * Grid.ActiveRow.Cells["ProductID"].Value = oRep.ID; * Grid.ActiveRow.Cells["InvCode"].Value = oRep.InvCode; * Grid.ActiveRow.Cells["Description"].Value = oRep.Description; * Grid.ActiveRow.Cells["Price"].Activate(); * Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); * return; * } * else * { * MessageBox.Show("Item already entered"); * Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; * Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); * return; * } * } */ } if (Grid.GetRow(ChildRow.Last) == Grid.ActiveRow) { oeMail.Items.AddEmpty(); Grid.DataBind(); MoveLast(); //Grid.PerformAction(UltraGridAction.LastRowInBand, false, false); } else { Grid.PerformAction(UltraGridAction.NextRowByTab, false, false); Grid.ActiveRow.Cells["destination"].Activate(); Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } } else { Grid.ActiveRow.Cells["destination"].Activate(); Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } return; } } if (e.KeyCode == Keys.Down) { MoveDown(); return; } if (e.KeyCode == Keys.Up) { Infragistics.Win.UltraWinGrid.UltraGridRow gridRow; gridRow = Grid.ActiveRow; gridRow = gridRow.GetSibling(Infragistics.Win.UltraWinGrid.SiblingRow.Previous); if (gridRow != null) { gridRow.Activate(); //' set ActiveCell Grid.ActiveCell = Grid.ActiveRow.Cells["destination"]; Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); } return; //SendKeys.Send("{TAB}"); } } #endregion #region txtProductID if (sender == txtRepID) { if (e.KeyCode.ToString() == "F2") { if (oRep.ViewByID()) { txtRepID.Text = oRep.ID.ToString(); txtDescription.Text = oRep.Name; } } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtRepID.Text.Trim().Length == 0) { txtRepID.Focus(); } if (oRep.Find(txtRepID.Text)) { txtRepID.Text = oRep.ID.ToString(); txtDescription.Text = oRep.Name; } } } #endregion #region Default Option //Default option switch (e.KeyCode) { case Keys.Tab: if (!e.Shift) { this.SelectNextControl(this.ActiveControl, true, true, true, true); } break; case Keys.Enter: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Down: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Up: this.SelectNextControl(this.ActiveControl, false, true, true, true); break; case Keys.F3: this.Delete(); txtAccountID.Focus(); break; case Keys.PageDown: this.Save(); Grid.DataBind(); Clear(); txtAccountID.Clear(); txtAccountID.Focus(); break; case Keys.Delete: if (e.Control) { DeleteItem(); } break; //case Keys.<some key>: // ......; // break; } #endregion }
private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { #region Grid if (sender == Grid) { if (Grid.ActiveCell != null) { switch (Grid.ActiveCell.Column.Key) { case "Received": if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Down || e.KeyCode == Keys.Tab) { Grid.PerformAction(UltraGridAction.NextRowByTab, false, false); Grid.ActiveCell = Grid.ActiveRow.Cells["Received"]; Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } if (e.KeyCode == Keys.Up) { Grid.PerformAction(UltraGridAction.PrevRowByTab, false, false); Grid.ActiveCell = Grid.ActiveRow.Cells["Received"]; Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } break; } } return; } #endregion #region txtOrderID if (sender == txtOrderID) { if (e.KeyCode == Keys.F2) { if (oPurchase.View(true)) { oReceive.FindPurchase(oPurchase.ID); txtOrderID.Text = oReceive.ID; txtVendorID.Text = oReceive.VendID; oVendor.Find(oReceive.VendID); txtName.Text = oVendor.Name; if (oReceive.RItems.Count > 0) { Grid.DataSource = oReceive.RItems; Grid.DataBind(); MoveFirst(); txtOrderID.Enabled = false; } else { MessageBox.Show("This PO was already received..."); } return; } this.txtName.Text = oVendor.Name; return; } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtOrderID.Text.Trim() == "") { txtOrderID.Clear(); txtOrderID.Focus(); return; } if (oReceive.FindPurchase(txtOrderID.Text)) { txtVendorID.Enabled = true; txtVendorID.Text = oReceive.VendID; oVendor.Find(oReceive.VendID); txtName.Text = oVendor.Name; Grid.DataSource = oReceive.Items; MoveFirst(); txtOrderID.Enabled = false; return; } else { txtVendorID.Enabled = true; txtVendorID.Focus(); return; } } } #endregion #region txtVendorID if (sender == txtVendorID) { if (e.KeyCode.ToString() == "F2") { if (oVendor.View()) { this.txtVendorID.Text = oVendor.ID; if (!oVendor.Find(txtVendorID.Text)) { this.txtVendorID.Focus(); return; } this.txtName.Text = oVendor.Name; Grid.Focus(); return; } this.txtName.Text = oVendor.Name; } if (e.KeyCode.ToString() == "Return" || e.KeyCode.ToString() == "Tab") { if (!oVendor.Find(txtVendorID.Text)) { this.txtVendorID.Focus(); return; } this.txtName.Text = oVendor.Name; //Grid.DataSource = oVendor.ReOrders.GetDataTable(oVendor); Grid.Focus(); return; } } #endregion #region Default Option //Default option switch (e.KeyCode) { case Keys.Tab: if (!e.Shift) { this.SelectNextControl(this.ActiveControl, true, true, true, true); } break; case Keys.Enter: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Down: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Up: this.SelectNextControl(this.ActiveControl, false, true, true, true); break; case Keys.F3: Delete(); break; case Keys.PageDown: break; //case Keys.<some key>: // ......; // break; } #endregion }
private void LoadTickets() { this.txtSearch.Focus(); Grid.DataSource = oOrder.Items[this.ProductID].Tickets; Grid.DataBind(); }