private void GetDetailsQueryData() { try { this.Cursor = Cursors.WaitCursor; //colBPostQty.Visible = lstMain[dgvList.CurrentCell.RowIndex].IsShelvePost.ToBoolean(); bool bResult = false; string strErr = string.Empty; GetQueryDetails(); ChensControl.DividPage clientPage = pageDetail.dDividPage; Common.Common_Func.GetServerPageFromClientPage(ref _serverDetailsPage, clientPage); bResult = Task_Func.GetTaskDetailListByPage(ref lstDetails, queryDetails, ref _serverDetailsPage, ref strErr); Common.Common_Func.GetClientPageFromServerPage(_serverDetailsPage, ref clientPage); pageDetail.ShowPage(); dgvDetail.DataSource = lstDetails; if (!bResult || !string.IsNullOrEmpty(strErr)) { Common.Common_Func.ErrorMessage(strErr, "查询失败"); } } catch (Exception ex) { Common.Common_Func.ErrorMessage(ex.Message, "查询失败"); } finally { this.Cursor = Cursors.Default; } }
private void GetListQueryData() { try { this.Cursor = Cursors.WaitCursor; bool bResult = false; string strErr = string.Empty; GetQueryMain(); ChensControl.DividPage clientPage = pageList.dDividPage; Common.Common_Func.GetServerPageFromClientPage(ref _serverMainPage, clientPage); bResult = Task_Func.GetTaskTransListByPage(ref lstMain, queryMain, ref _serverMainPage, ref strErr); Common.Common_Func.GetClientPageFromServerPage(_serverMainPage, ref clientPage); pageList.ShowPage(); dgvList.DataSource = lstMain; if (!bResult || !string.IsNullOrEmpty(strErr)) Common.Common_Func.ErrorMessage(strErr, "查询失败"); } catch (Exception ex) { Common.Common_Func.ErrorMessage(ex.Message, "查询失败"); } finally { this.Cursor = Cursors.Default; } }
private void GetListQueryData() { try { this.Cursor = Cursors.WaitCursor; bsMain.EndEdit(); bool bResult = false; string strErr = string.Empty; GetQueryMain(); if (queryMain.StartTime != null && queryMain.EndTime != null) { if (queryMain.StartTime.ToDateTime().Date > queryMain.EndTime.ToDateTime().Date) { Common.Common_Func.ErrorMessage("开始日期不能大于结束日期", "查询失败"); return; } } ChensControl.DividPage clientPage = pageList.dDividPage; Common.Common_Func.GetServerPageFromClientPage(ref _serverMainPage, clientPage); bResult = Task_Func.GetTaskMainListByPage(ref lstMain, queryMain, ref _serverMainPage, ref strErr); Common.Common_Func.GetClientPageFromServerPage(_serverMainPage, ref clientPage); pageList.ShowPage(); dgvList.DataSource = lstMain; if (!bResult || !string.IsNullOrEmpty(strErr)) { Common.Common_Func.ErrorMessage(strErr, "查询失败"); } if (dgvList.DataSource == null || dgvList.Rows.Count <= 0) { lstDetails = new List <OverViewDetailInfo>(); dgvDetail.DataSource = lstDetails; return; } else { pageDetail.dDividPage.CurrentPageNumber = 1; GetDetailsQueryData(); } } catch (Exception ex) { Common.Common_Func.ErrorMessage(ex.Message, "查询失败"); } finally { this.Cursor = Cursors.Default; txtTaskNo.Focus(); } }
private void BindComboboxs() { Common_Func.BindComboBoxAddAll(Task_Func.GetIsQuality(), cbbIsQuality); Common_Func.BindComboBoxAddAll(Task_Func.GetTaskStatus(true), cbbTaskStatus); Common_Func.BindComboBoxAddAll(Task_Func.GetOrderType(true), cbbVoucherType); Common_Func.BindComboBoxAddAll(Task_Func.GetPostStatus(), cbbPostStatus); Common_Func.BindComboBoxAddAllByKey(cbbWarehouse.Name, cbbWarehouse); }
private bool PostOutsourcing() { try { this.Cursor = Cursors.WaitCursor; bsMain.EndEdit(); this.dgvList.EndEdit(); if (supplier == null) { if (!GetSupplier()) { return(false); } } queryMain.DocDate = dtpDocDate.Value; queryMain.PostDate = dtpPostDate.Value; queryMain.OutSideSupCode = supplier.SupplierCode; queryMain.OutSideSupName = supplier.SupplierName; bool bResult = false; string strError = string.Empty; queryMain.lstDeliveryDetail = new List <DeliveryReceiveDetail_Model>(lstMain); bResult = Task_Func.PostOutSideByDeliveryAndPOToSAP(ref queryMain, ref strError); //queryMain.Operator = Common_Var.CurrentUser.UserName; bsMain.DataSource = queryMain; if (!bResult || !string.IsNullOrEmpty(strError)) { return(Common.Common_Func.ErrorMessage(strError, "过账失败")); } return(true); } catch (Exception ex) { Common.Common_Func.ErrorMessage(ex.Message, "过账失败"); return(false); } finally { this.Cursor = Cursors.Default; txtDeliveryNo.Focus(); } }
private void GetListQueryData() { try { this.Cursor = Cursors.WaitCursor; bsMain.EndEdit(); bool bResult = false; string strError = string.Empty; GetQueryMain(); bResult = Task_Func.GetDeliveryInfoToSRM(ref queryMain, ref strError); bsMain.DataSource = queryMain; if (!bResult || !string.IsNullOrEmpty(strError)) { Common.Common_Func.ErrorMessage(strError, "查询失败"); } if (queryMain.lstDeliveryDetail == null || queryMain.lstDeliveryDetail.Count <= 0) { lstMain = new BindingList <DeliveryReceiveDetail_Model>(); dgvList.DataSource = lstMain; txtOutSideSupCode.Enabled = false; txtOutSideSupCode.Text = ""; txtDeliveryNo.Focus(); txtDeliveryNo.SelectAll(); } else { supplier = null; queryMain.lstDeliveryDetail.ForEach(t => t.ReceiveQty = t.CurrentlyDeliveryNum); lstMain = new BindingList <DeliveryReceiveDetail_Model>(queryMain.lstDeliveryDetail); dgvList.DataSource = lstMain; txtOutSideSupCode.Enabled = true; txtOutSideSupCode.Focus(); txtOutSideSupCode.SelectAll(); } if (queryMain.DocDate != null) { dtpDocDate.Value = queryMain.DocDate.ToDateTime(); } if (queryMain.PostDate != null) { dtpPostDate.Value = queryMain.PostDate.ToDateTime(); } } catch (Exception ex) { Common.Common_Func.ErrorMessage(ex.Message, "查询失败"); txtDeliveryNo.Focus(); txtDeliveryNo.SelectAll(); } finally { this.Cursor = Cursors.Default; } }
private void ExportDetail() { if (dgvList.DataSource == null || dgvList.Rows.Count <= 0) { MessageBox.Show("请先查询到结果后再尝试导出明细", "导出失败"); return; } bsMain.EndEdit(); string strErrMsg = string.Empty; List <OverViewExportInfo> lstExport = new List <OverViewExportInfo>(); OverViewExportInfo queryExport = new OverViewExportInfo(); try { this.Cursor = Cursors.WaitCursor; queryExport.TaskType = queryMain.TaskType; queryExport.StartTime = queryMain.StartTime; queryExport.EndTime = queryMain.EndTime; queryExport.DeliveryNo = queryMain.DeliveryNo; queryExport.MaterialDoc = queryMain.MaterialDoc; queryExport.TaskNo = queryMain.TaskNo; queryExport.SupCusNo = queryMain.SupcusNo; queryExport.ReceiveUserNo = queryMain.ReceiveUserNo; queryExport.TaskStatus = queryMain.TaskStatus; queryExport.VoucherType = queryMain.VoucherType; queryExport.PostStatus = queryMain.PostStatus; queryExport.IsQuality = queryMain.IsQuality; queryExport.WarehouseID = queryMain.WarehouseID; DividPage serverPage = new DividPage(); serverPage.CurrentPageNumber = 1; serverPage.CurrentPageShowCounts = -1; if (!Task_Func.GetOverViewExportListByPage(ref lstExport, queryExport, ref serverPage, ref strErrMsg)) { MessageBox.Show(strErrMsg, "导出失败"); return; } } catch (Exception ex) { MessageBox.Show(ex.Message, "导出失败"); return; } finally { this.Cursor = Cursors.Default; } try { string excludecol = "ID,Task_ID,TaskStatus,PlantName,Remark,Reason,PostStatus,StartTime,EndTime,WarehouseCode,WarehouseID,ReceiveUserNo,OperatorUserNo,CreateUserNo,IsShelvePost,IsQuality,IsReceivePost,VoucherType,TaskType,StrTaskType,VoucherNo,Status,IsQualityComp,Unit,CompleteDateTime"; Dictionary <string, string> dicFields = new Dictionary <string, string>(); dicFields.Add("TaskNo", "任务单号"); dicFields.Add("DeliveryNo", "单据编号"); dicFields.Add("SupCusNo", "供应商代码"); dicFields.Add("SupCusName", "供应商名称"); dicFields.Add("TaskIssued", "任务下发时间"); dicFields.Add("ReceiveUserName", "收货人"); dicFields.Add("Plant", "工厂"); dicFields.Add("StrVoucherType", "入库类型"); dicFields.Add("StrTaskType", "任务类型"); dicFields.Add("StrIsQuality", "是否质检"); dicFields.Add("StrIsShelvePost", "是否上架过账"); dicFields.Add("StrIsReceivePost", "是否收货过账"); dicFields.Add("StrTaskStatus", "任务状态"); dicFields.Add("StrPostStatus", "过账状态"); dicFields.Add("MaterialDoc", "物料凭证"); dicFields.Add("WarehouseName", "仓库名称"); dicFields.Add("CreateUserName", "创建人"); dicFields.Add("CreateDateTime", "创建时间"); dicFields.Add("ToAreaNo", "入库货位"); dicFields.Add("RowNo", "行号"); dicFields.Add("VoucherNo", "订单号"); dicFields.Add("MaterialNo", "物料编号"); dicFields.Add("MaterialDesc", "物料描述"); dicFields.Add("TaskQty", "任务数量"); dicFields.Add("QualityQty", "质检数量"); dicFields.Add("RemainQty", "剩余数量"); dicFields.Add("ShelveQty", "已上架数量"); dicFields.Add("UnQualityQty", "不合格数量"); dicFields.Add("PostQty", "过账数量"); dicFields.Add("OperatorUserName", "操作人"); dicFields.Add("OperatorDateTime", "操作时间"); dicFields.Add("Unit", "计量单位"); dicFields.Add("StrStatus", "状态"); dicFields.Add("StrIsQualityComp", "是否质检完成"); dicFields.Add("CompleteDateTime", "完成时间"); ExcelLibrary.ExcelLibrary_Func.SaveListToExcelByNPOI(lstExport, true, excludecol, dicFields, dgvList.DefaultCellStyle.Font); } catch (Exception ex) { MessageBox.Show(ex.Message, "导出失败"); return; } }