private List <AscmMtlOnhandQuantitiesDetail> DataBindDataGridView(ref int count, int queryId) { List <AscmMtlOnhandQuantitiesDetail> list = null; string message = string.Empty; string _ynPage = string.Empty; YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage(); ynPage.SetPageSize(pagerControlMaterial.PageSize); ynPage.SetCurrentPage((pagerControlMaterial.PageCurrent <= 0) ? 1 : pagerControlMaterial.PageCurrent); _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage); try { AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); string jsonString = Service.GetMaterialWarehouseList(frmMainView.encryptTicket, materialId, ref _ynPage, ref message); if (!string.IsNullOrEmpty(jsonString)) { list = (List <AscmMtlOnhandQuantitiesDetail>)JsonConvert.DeserializeObject(jsonString, typeof(List <AscmMtlOnhandQuantitiesDetail>)); if (list != null && list.Count > 0) { ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage); count = ynPage.GetRecordCount(); } } } catch (Exception ex) { throw ex; } return(list); }
private void tsbEndTask_Click(object sender, EventArgs e) { try { string message = string.Empty; WinForm.AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); if (Service.EndExcuteTask(frmMain.encryptTicket, frmMain.userName, ref message)) { MessageBoxEx.Show("正在执行的任务结束!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); pageControlTask.Bind(); } else { if (!string.IsNullOrEmpty(message)) { MessageBox.Show(message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("请检查任务领料数量,无法执行结束任务操作!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } pageControlTask.Bind(); } } catch (Exception ex) { throw ex; } }
private List <AscmMaterialItem> GetMaterialItem(ref int count) { List <AscmMaterialItem> list = null; string message = string.Empty; string _ynPage = string.Empty; YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage(); ynPage.SetPageSize(pcMaterialList.PageSize); ynPage.SetCurrentPage((pcMaterialList.PageCurrent <= 0) ? 1 : pcMaterialList.PageCurrent); _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage); try { WinForm.AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); string jsonStr = Service.SumMaterialTotal(frmMain.encryptTicket, ref _ynPage, ref message); if (!string.IsNullOrEmpty(jsonStr)) { list = (List <AscmMaterialItem>)JsonConvert.DeserializeObject(jsonStr, typeof(List <AscmMaterialItem>)); if (list != null && list.Count > 0) { ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage); count = ynPage.GetRecordCount(); } else { MessageBoxEx.Show("系统没查到当天的作业单的所有物料!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { throw ex; } return(list); }
/// <summary> /// 任务删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnTaskDelete_Click(object sender, EventArgs e) { if (MessageBoxEx.Show("确认删除所选任务?", "系统提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { if (dataGridViewTasks.SelectedRows == null) { MessageBoxEx.Show("请先选中要删除的数据行!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { string message = string.Empty; try { int id = int.Parse(dataGridViewTasks.SelectedRows[0].Cells["ID"].Value.ToString()); WinForm.AscmWebService.AscmWebService service = new AscmWebService.AscmWebService(); if (service.TaskDelete(frmMain.encryptTicket, id, ref message)) { btnTasksSearch_Click(this, new EventArgs()); MessageBoxEx.Show("删除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBoxEx.Show(message, "删除失败", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { MessageBoxEx.Show(ex.Message, "删除失败", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
public List <AscmGetMaterialTask> GetMaterialTaskInfo() { List <AscmGetMaterialTask> list = null; try { string message = string.Empty; if (!string.IsNullOrEmpty(GetMaterialTaskId)) { WinForm.AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); string jsonStr = Service.CheckTaskInfo(frmMain.encryptTicket, GetMaterialTaskId, ref message); if (!string.IsNullOrEmpty(jsonStr)) { list = (List <AscmGetMaterialTask>)JsonConvert.DeserializeObject(jsonStr, typeof(List <AscmGetMaterialTask>)); if (list == null || list.Count == 0) { MessageBoxEx.Show("没有查到符合该条件任务信息!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } } catch (Exception ex) { throw ex; } return(list); }
private List <AscmWipRequirementOperations> DataBindDataGridView(ref int count, string queryStartTime, string queryEndTime) { List <AscmWipRequirementOperations> list = null; string message = string.Empty; string _ynPage = string.Empty; YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage(); ynPage.SetPageSize(pagerControlMaterial.PageSize); ynPage.SetCurrentPage((pagerControlMaterial.PageCurrent <= 0) ? 1 : pagerControlMaterial.PageCurrent); _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage); try { AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); string jsonString = Service.SumMaterial(frmMainView.encryptTicket, frmMainView.userName, queryStartTime, queryEndTime, ref _ynPage, ref message); if (!string.IsNullOrEmpty(jsonString)) { list = (List <AscmWipRequirementOperations>)JsonConvert.DeserializeObject(jsonString, typeof(List <AscmWipRequirementOperations>)); if (list != null && list.Count > 0) { ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage); count = ynPage.GetRecordCount(); } } } catch (Exception ex) { throw ex; } return(list); }
private void btnLinkWarehouse_Click(object sender, EventArgs e) { try { string message = "", queryWord = ""; if (!string.IsNullOrEmpty(cbWarehouse.Text)) { queryWord = cbWarehouse.Text.Trim().ToUpper(); } AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); string jsonString = Service.GetSomeWareHouse(frmMainView.encryptTicket, queryWord, ref message); if (!string.IsNullOrEmpty(jsonString)) { List <AscmWarehouse> list = (List <AscmWarehouse>)JsonConvert.DeserializeObject(jsonString, typeof(List <AscmWarehouse>)); if (list != null && list.Count > 0) { StructComboBoxWarehouse(this.cbWarehouse, list); } } } catch (Exception ex) { MessageBoxEx.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); throw ex; } }
/// <summary> /// 物料查询 返回查询总数量与单页数据 /// </summary> /// <param name="count"></param> /// <returns></returns> private List <AscmMaterialItem> materialQuery(ref int count) { List <AscmMaterialItem> listMaterials = null; string message = string.Empty; string _ynPage = string.Empty; string queryMaterialDocNumber = txtMaterialDocNumber.Text; YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage(); ynPage.SetPageSize(pageControlMaterial.PageSize); ynPage.SetCurrentPage((pageControlMaterial.PageCurrent <= 0) ? 1 : pageControlMaterial.PageCurrent); _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage); WinForm.AscmWebService.AscmWebService service = new AscmWebService.AscmWebService(); string jsonstr = service.GetMaterialList(frmMain.encryptTicket, queryMaterialDocNumber, ref _ynPage, ref message); if (!string.IsNullOrEmpty(jsonstr)) { listMaterials = (List <AscmMaterialItem>)JsonConvert.DeserializeObject(jsonstr, typeof(List <AscmMaterialItem>)); if (listMaterials != null && listMaterials.Count > 0) { ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage); count = ynPage.GetRecordCount(); } else { MessageBoxEx.Show("没有查询到符合条件的领料任务!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } return(listMaterials); }
private List <AscmGetMaterialTask> DataBindDataGridView(ref int count, string queryStartTime, string queryEndTime, string queryTaskStatus) { List <AscmGetMaterialTask> list = null; string message = string.Empty; string _ynPage = string.Empty; YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage(); ynPage.SetPageSize(pagerControlTask.PageSize); ynPage.SetCurrentPage((pagerControlTask.PageCurrent <= 0) ? 1 : pagerControlTask.PageCurrent); _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage); try { string queryStatus = string.Empty; if (queryTaskStatus != null) { switch (queryTaskStatus.ToString()) { case "已分配": queryStatus = "NOTEXECUTE"; break; case "执行中": queryStatus = "EXECUTE"; break; case "已完成": queryStatus = "FINISH"; break; case "已关闭": queryStatus = "CLOSE"; break; default: queryStatus = ""; break; } } AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); string jsonString = Service.GetUnAutoTaskList(frmMainView.encryptTicket, queryStartTime, queryEndTime, queryStatus, ref _ynPage, ref message); if (!string.IsNullOrEmpty(jsonString)) { list = (List <AscmGetMaterialTask>)JsonConvert.DeserializeObject(jsonString, typeof(List <AscmGetMaterialTask>)); if (list != null && list.Count > 0) { ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage); count = ynPage.GetRecordCount(); } } } catch (Exception ex) { throw ex; } return(list); }
private List <AscmWipRequirementOperations> DataBindAdvTreeSecondLevelNode(int id, string mtlCategory) { List <AscmWipRequirementOperations> list = null; string message = string.Empty; AscmWebService.AscmWebService service = new AscmWebService.AscmWebService(); string jsonString = service.GetMonitorJobList(frmMainView.encryptTicket, id, mtlCategory, ref message); if (!string.IsNullOrEmpty(jsonString)) { list = (List <AscmWipRequirementOperations>)JsonConvert.DeserializeObject(jsonString, typeof(List <AscmWipRequirementOperations>)); } return(list); }
private void tsbStartTask_Click(object sender, EventArgs e) { try { string str = string.Empty; string message = string.Empty; foreach (Node node in advTree1.Nodes) { if (node.Checked) { if (!string.IsNullOrEmpty(str)) { str += ","; } str += node.Text; } } if (!string.IsNullOrEmpty(str)) { WinForm.AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); if (Service.StartExcuteTask(frmMain.encryptTicket, frmMain.userName, str, ref message)) { MessageBoxEx.Show("任务开始执行!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (!string.IsNullOrEmpty(message)) { MessageBox.Show(message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("请检查任务状态,无法执行开始操作!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } else { MessageBox.Show("请选择任务!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } pageControlTask.Bind(); } catch (Exception ex) { throw ex; } }
private void btnItemAdd_Click(object sender, EventArgs e) { frmAddTaskForm frmAddTaskForm = new frmAddTaskForm(); frmAddTaskForm.ShowDialog(); if (frmAddTaskForm.DialogResult == DialogResult.OK) { AscmGetMaterialTask ascmGetMaterialTask = frmAddTaskForm.ascmGetMaterialTask; string jsonString = JsonConvert.SerializeObject(ascmGetMaterialTask); string message = ""; AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); if (Service.AddUnAutoTask(frmMainView.encryptTicket, frmMainView.userName, jsonString, ref message)) { pagerControlTask.Bind(); } } }
public string GetTaskBarNotifierData() { string message = ""; string taskString = string.Empty; try { AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); taskString = Service.GetTaskbarNotifierMessage(frmMainView.encryptTicket, frmMainView.userName, ref message); taskString = taskString.Replace(",", "\r"); } catch (Exception ex) { message = ex.Message; } return(taskString); }
private void btnItemStop_Click(object sender, EventArgs e) { try { string message = string.Empty; if (string.IsNullOrEmpty(releaseHeaderIds)) { MessageBox.Show("请选择任务!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { string[] myArray = releaseHeaderIds.Split(','); string newReleaseHeaderIds = string.Empty; foreach (string item in myArray) { if (!string.IsNullOrEmpty(newReleaseHeaderIds) && !string.IsNullOrEmpty(item)) { newReleaseHeaderIds += ","; } if (!string.IsNullOrEmpty(item)) { newReleaseHeaderIds += item; } } releaseHeaderIds = newReleaseHeaderIds; AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); if (Service.EndExcuteTask(frmMainView.encryptTicket, frmMainView.userName, releaseHeaderIds, ref message)) { MessageBoxEx.Show("任务已结束!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); pageControlTask.Bind(); } else { MessageBox.Show(message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } releaseHeaderIds = ""; } catch (Exception ex) { throw ex; } }
private void tsbGetMaterial_Click(object sender, EventArgs e) { try { string str = string.Empty; string message = string.Empty; foreach (Node node in advTree1.Nodes) { if (node.Checked) { if (!string.IsNullOrEmpty(str)) { str += ","; } str += node.Text; } } if (!string.IsNullOrEmpty(str)) { WinForm.AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); Service.ConfrimedGetMaterial(frmMain.encryptTicket, frmMain.userName, str, ref message); pageControlTask.Bind(); if (!string.IsNullOrEmpty(message)) { MessageBox.Show(message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("请检查该任务备料数量,无法执行领料操作!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("请选择任务!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { throw ex; } }
private void btnItemUnMark_Click(object sender, EventArgs e) { try { string message = string.Empty; AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); if (Service.UnMarkTask(frmMainView.encryptTicket, frmMainView.userName, this.taskId, this.jobId, ref message)) { pageControlTask.Bind(); } else { MessageBox.Show(message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { throw ex; } }
private void btnItemSure_Click(object sender, EventArgs e) { try { string message = ""; AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); if (Service.ConfrimedBatchGetmaterials(frmMainView.encryptTicket, frmMainView.userName, releaseHeaderIds, ref message)) { MessageBoxEx.Show("领料成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); pageControlTask.Bind(); releaseHeaderIds = ""; } else { MessageBox.Show(message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { throw ex; } }
private List <AscmWipDiscreteJobs> getWipDiscreteJobsList(ref int count) { List <AscmWipDiscreteJobs> listJobs = null; string message = string.Empty; string _ynPage = string.Empty; try { YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage(); ynPage.SetPageSize(pageControlJob.PageSize); ynPage.SetCurrentPage((pageControlJob.PageCurrent <= 0) ? 1 : pageControlJob.PageCurrent); _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage); string startdate = startDate.Value.ToString("yyyy-MM-dd"); string enddate = endDate.Value.ToString("yyyy-MM-dd"); AscmWebService.AscmWebService service = new AscmWebService.AscmWebService(); string jsonstr = service.MaterialOfDiscreteJobList(frmMain.encryptTicket, materialId, startdate, enddate, ref _ynPage, ref message); if (!string.IsNullOrEmpty(jsonstr)) { listJobs = (List <AscmWipDiscreteJobs>)JsonConvert.DeserializeObject(jsonstr, typeof(List <AscmWipDiscreteJobs>)); if (listJobs != null && listJobs.Count > 0) { ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage); count = ynPage.GetRecordCount(); } else { MessageBoxEx.Show("没有查询到符合条件的作业!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { MessageBoxEx.Show(ex.Message + message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(listJobs); }
private List<AscmWipDiscreteJobs> getWipDiscreteJobsList(ref int count) { List<AscmWipDiscreteJobs> listJobs = null; string message = string.Empty; string _ynPage = string.Empty; try { YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage(); ynPage.SetPageSize(pageControlJob.PageSize); ynPage.SetCurrentPage((pageControlJob.PageCurrent <= 0) ? 1 : pageControlJob.PageCurrent); _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage); string startdate = startDate.Value.ToString("yyyy-MM-dd"); string enddate = endDate.Value.ToString("yyyy-MM-dd"); AscmWebService.AscmWebService service = new AscmWebService.AscmWebService(); string jsonstr = service.MaterialOfDiscreteJobList(frmMain.encryptTicket, materialId, startdate, enddate, ref _ynPage, ref message); if (!string.IsNullOrEmpty(jsonstr)) { listJobs = (List<AscmWipDiscreteJobs>)JsonConvert.DeserializeObject(jsonstr, typeof(List<AscmWipDiscreteJobs>)); if (listJobs != null && listJobs.Count > 0) { ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage); count = ynPage.GetRecordCount(); } else { MessageBoxEx.Show("没有查询到符合条件的作业!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { MessageBoxEx.Show(ex.Message + message, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } return listJobs; }
private void btnEditTask_Click(object sender, EventArgs e) { string message = string.Empty; try { AscmGetMaterialTask task = (editTask == null) ? (new AscmGetMaterialTask()) : editTask; task.productLine = txtProductLine.Text; task.warehouserId = (cmbWarehouserId.SelectedItem == null) ? cmbWarehouserId.Text : ((KeyValuePair <object, string>)cmbWarehouserId.SelectedItem).Value; task.mtlCategoryStatus = (cmbMtlCategoryStatus.SelectedItem == null) ? cmbMtlCategoryStatus.Text : ((KeyValuePair <object, string>)cmbMtlCategoryStatus.SelectedItem).Value; task.rankerId = (cmbRankerId.SelectedItem == null) ? cmbRankerId.Text : ((KeyValuePair <object, string>)cmbRankerId.SelectedItem).Value; task.IdentificationId = (cmbIdentificationId.SelectedItem == null) ? 0 : int.Parse(((KeyValuePair <object, string>)cmbIdentificationId.SelectedItem).Value); task.materialDocNumber = (cmbMaterialDocNumber.SelectedItem == null) ? cmbMaterialDocNumber.Text : ((KeyValuePair <object, string>)cmbMaterialDocNumber.SelectedItem).Value; task.taskTime = (cmbTaskTime.SelectedItem == null) ? cmbTaskTime.Text : ((KeyValuePair <object, string>)cmbTaskTime.SelectedItem).Value; task.tip = (cmbTip.SelectedItem == null) ? cmbTip.Text : ((KeyValuePair <object, string>)cmbTip.SelectedItem).Value; task.workerId = cmbWorkerId.Text; task.modifyUser = frmMain.userName; string xmlstr = YnBaseClass2.Helper.ObjectHelper.Serialize(task); WinForm.AscmWebService.AscmWebService service = new AscmWebService.AscmWebService(); if (service.EditTaskSave(frmMain.encryptTicket, xmlstr, ref message)) { if (refreshHandler != null) { refreshHandler(this, new EventArgs()); } MessageBoxEx.Show("修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBoxEx.Show(message, "修改失败", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { MessageBoxEx.Show(ex.Message, "修改失败", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private List <AscmWipRequirementOperations> GetWipRequirementOperations(ref int count) { List <AscmWipRequirementOperations> list = null; string message = string.Empty; string _ynPage = string.Empty; YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage(); ynPage.SetPageSize(pageControlMaterial.PageSize); ynPage.SetCurrentPage((pageControlMaterial.PageCurrent <= 0) ? 1 : pageControlMaterial.PageCurrent); _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage); try { if (!string.IsNullOrEmpty(GetMaterialTaskId) && !string.IsNullOrEmpty(DiscreteJobsId)) { WinForm.AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); string jsonStr = Service.GetMtlList(frmMain.encryptTicket, GetMaterialTaskId, DiscreteJobsId, ref _ynPage, ref message); if (!string.IsNullOrEmpty(jsonStr)) { list = (List <AscmWipRequirementOperations>)JsonConvert.DeserializeObject(jsonStr, typeof(List <AscmWipRequirementOperations>)); if (list != null && list.Count > 0) { ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage); count = ynPage.GetRecordCount(); } else { MessageBoxEx.Show("没有查询到符合条件的领料任务!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } } catch (Exception ex) { throw ex; } return(list); }
private void btnItemDelete_Click(object sender, EventArgs e) { try { foreach (DataGridViewRow dr in this.dgViewTaskList.Rows) { if (dr.Selected) { int id = int.Parse(dr.Cells[0].Value.ToString()); string message = ""; AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); if (Service.DeleteUnAutoTask(frmMainView.encryptTicket, frmMainView.userName, id, ref message)) { pagerControlTask.Bind(); } } } } catch (Exception ex) { MessageBoxEx.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnLinkMark_Click(object sender, EventArgs e) { try { string message = ""; AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); string jsonString = Service.GetSomeRelatedMarkList(frmMainView.encryptTicket, ref message); if (!string.IsNullOrEmpty(jsonString)) { List <AscmMarkTaskLog> list = (List <AscmMarkTaskLog>)JsonConvert.DeserializeObject(jsonString, typeof(List <AscmMarkTaskLog>)); if (list != null && list.Count > 0) { StructComboBoxMark(this.cbRelated, list); } } } catch (Exception ex) { MessageBoxEx.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); throw ex; } }
private List <AscmWipRequirementOperations> DataBindDataGridView(ref int count) { List <AscmWipRequirementOperations> list = null; string message = string.Empty; string _ynPage = string.Empty; YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage(); ynPage.SetPageSize(pagerControlMaterial.PageSize); ynPage.SetCurrentPage((pagerControlMaterial.PageCurrent <= 0) ? 1 : pagerControlMaterial.PageCurrent); _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage); try { if (taskId != 0 && jobId != 0) { AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); //string jsonString = Service.GetMonistorMaterialList(frmMainView.encryptTicket, taskId.ToString(), jobId.ToString(), ref _ynPage, ref message); string jsonString = Service.GetMonitorMaterialList(frmMainView.encryptTicket, taskId.ToString(), jobId.ToString(), tbItemWarehouse.Text, tbItemMtlCategory.Text, ref _ynPage, ref message); if (!string.IsNullOrEmpty(jsonString)) { list = (List <AscmWipRequirementOperations>)JsonConvert.DeserializeObject(jsonString, typeof(List <AscmWipRequirementOperations>)); if (list != null && list.Count > 0) { ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage); count = ynPage.GetRecordCount(); } } } } catch (Exception ex) { throw ex; } return(list); }
private List <AscmWipDiscreteJobs> GetJobTree(int jobId) { List <AscmWipDiscreteJobs> listJobs = null; string message = string.Empty; try { WinForm.AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); string jsonStr = Service.GetJobList(frmMain.encryptTicket, jobId, ref message); if (!string.IsNullOrEmpty(jsonStr)) { listJobs = (List <AscmWipDiscreteJobs>)JsonConvert.DeserializeObject(jsonStr, typeof(List <AscmWipDiscreteJobs>)); if (listJobs == null || listJobs.Count == 0) { MessageBoxEx.Show("没有查询到符合条件的领料任务!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { throw ex; } return(listJobs); }
/// <summary> /// 任务分页查询 返回数量与单页数据 /// </summary> /// <param name="count"></param> /// <returns></returns> private List <AscmGetMaterialTask> taskQuery(ref int count) { List <AscmGetMaterialTask> listTasks = null; string message = string.Empty; string _ynPage = string.Empty; YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage(); ynPage.SetPageSize(pageControlTask.PageSize); ynPage.SetCurrentPage((pageControlTask.PageCurrent <= 0) ? 1 : pageControlTask.PageCurrent); _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage); //try //{ string queryStatus = (cbxTaskStatus.SelectedItem == null) ? string.Empty : cbxTaskStatus.SelectedItem.ToString().Trim(); if (!String.IsNullOrEmpty(queryStatus)) { switch (queryStatus) { case "已完成": queryStatus = "FINISH"; break; case "执行中": queryStatus = "EXECUTE"; break; case "已分配": queryStatus = "NOTEXECUTE"; break; case "未分配": queryStatus = "NOTALLOCATE"; break; default: queryStatus = ""; break; } } string queryDate = taskCreateTime.Text.Trim(); if (!String.IsNullOrEmpty(queryDate)) { if (queryDate.LastIndexOf("星") > 0) { queryDate = queryDate.Substring(0, queryDate.LastIndexOf("星")); } queryDate = DateTime.Parse(queryDate).ToString("yyyy-MM-dd"); } WinForm.AscmWebService.AscmWebService service = new AscmWebService.AscmWebService(); string jsonstr = service.GetTasksList(frmMain.encryptTicket, queryStatus, queryDate, ref _ynPage, ref message); if (!string.IsNullOrEmpty(jsonstr)) { listTasks = (List <AscmGetMaterialTask>)JsonConvert.DeserializeObject(jsonstr, typeof(List <AscmGetMaterialTask>)); if (listTasks != null && listTasks.Count > 0) { ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage); count = ynPage.GetRecordCount(); } else { MessageBoxEx.Show("没有查询到符合条件的领料任务!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } //} //catch (Exception ex) //{ // throw ex; //} return(listTasks); }
private List <AscmGetMaterialTask> GetTaskTree(ref int count) { List <AscmGetMaterialTask> listTasks = null; string message = string.Empty; string _ynPage = string.Empty; YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage(); ynPage.SetPageSize(pageControlTask.PageSize); ynPage.SetCurrentPage((pageControlTask.PageCurrent <= 0) ? 1 : pageControlTask.PageCurrent); _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage); try { string status = (tscbTaskStatus.SelectedItem == null) ? string.Empty : tscbTaskStatus.SelectedItem.ToString().Trim(); if (!string.IsNullOrEmpty(status)) { switch (status) { case "已完成": status = "FINISH"; break; case "执行中": status = "EXECUTE"; break; case "已分配": status = "NOTEXECUTE"; break; case "未分配": status = "NOTALLOCATE"; break; default: status = ""; break; } } WinForm.AscmWebService.AscmWebService Service = new AscmWebService.AscmWebService(); string jsonStr = Service.GetTaskList(frmMain.encryptTicket, frmMain.userName, status, ref _ynPage, ref message); if (!string.IsNullOrEmpty(jsonStr)) { listTasks = (List <AscmGetMaterialTask>)JsonConvert.DeserializeObject(jsonStr, typeof(List <AscmGetMaterialTask>)); if (listTasks != null && listTasks.Count > 0) { ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage); count = ynPage.GetRecordCount(); } else { MessageBoxEx.Show("没有查询到符合条件的领料任务!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch (Exception ex) { throw ex; } return(listTasks); }
/// <summary> /// 登录按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnLogin_Click(object sender, EventArgs e) { string username = ""; string password = ""; #region 用户登录检测 if (!String.IsNullOrEmpty(txtUsername.Text.Trim())) { username = txtUsername.Text.Trim(); } else { MessageBoxEx.Show("请输入登录用户名", "登录提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (!String.IsNullOrEmpty(txtPassword.Text.Trim())) { password = txtPassword.Text.Trim(); } else if (username.ToLower() == "admin")//其它用户允许空密码 { MessageBoxEx.Show("请输入登录密码", "登录提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } #endregion #region 用户登录判断 WinForm.AscmWebService.AscmWebService service = new AscmWebService.AscmWebService(); string message = ""; string encryptTicket = ""; try { if (service.UserAuthentication(username, password, YnBaseClass2.Helper.HostHelper.GetHostIP(), ref message, ref encryptTicket)) { //Main_Form.encryptTicket = encryptTicket; //Main_Form.userName = username; //this.DialogResult = DialogResult.OK; //this.Close(); if (cbUserPwd.Checked == true) { Remember(true, username, password); } else { Remember(false, username, password); } frmMain.encryptTicket = encryptTicket; frmMain.userName = username; this.DialogResult = DialogResult.OK; this.Close(); } else { MessageBoxEx.Show(message, "登录失败", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { message = ex.Message; MessageBoxEx.Show(message, "登录失败", MessageBoxButtons.OK, MessageBoxIcon.Error); } #endregion }
private List <AscmWipDiscreteJobs> DataBindAdvTreeFristLevelNode(ref int count, string taskString) { List <AscmWipDiscreteJobs> list = null; string message = string.Empty; string _ynPage = string.Empty; YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage(); ynPage.SetPageSize(pageControlTask.PageSize); ynPage.SetCurrentPage((pageControlTask.PageCurrent <= 0) ? 1 : pageControlTask.PageCurrent); _ynPage = YnBaseClass2.Helper.ObjectHelper.Serialize(ynPage); try { string queryType = string.Empty; if (cbItemTaskType.SelectedItem != null) { switch (cbItemTaskType.SelectedItem.ToString()) { case "总装": queryType = "1"; break; case "电装": queryType = "2"; break; default: queryType = ""; break; } } string queryFormat = string.Empty; if (cbItemMtlCategoryStatus.SelectedItem != null) { switch (cbItemMtlCategoryStatus.SelectedItem.ToString()) { case "有库存": queryFormat = "INSTOCK"; break; case "须备料": queryFormat = "PRESTOCK"; break; case "须配料": queryFormat = "MIXSTOCK"; break; case "特殊子库": queryFormat = "SPECWAREHOUSE"; break; case "临时任务": queryFormat = "TEMPTASK"; break; default: queryFormat = ""; break; } } string queryStatus = string.Empty; if (cbItemTaskStatus.SelectedItem != null) { switch (cbItemTaskStatus.SelectedItem.ToString()) { case "已分配": queryStatus = "NOTEXECUTE"; break; case "执行中": queryStatus = "EXECUTE"; break; case "已完成": queryStatus = "FINISH"; break; case "已关闭": queryStatus = "CLOSE"; break; default: queryStatus = ""; break; } } string queryLine = (tbItemProductLine.Text == "") ? string.Empty : tbItemProductLine.Text.ToUpper().ToString(); string queryTime = (cbItemTaskTime.SelectedItem == null) ? string.Empty : cbItemTaskTime.SelectedItem.ToString(); string queryWarehouse = (tbItemWarehouse.Text == "") ? string.Empty : tbItemWarehouse.Text.ToUpper().ToString(); AscmWebService.AscmWebService service = new AscmWebService.AscmWebService(); string jsonString = service.GetMonitorTaskList(frmMainView.encryptTicket, frmMainView.userName, tbItemStart.Text, tbItemEnd.Text, tbItemJobStart.Text, tbItemJobEnd.Text, queryType, queryFormat, queryStatus, queryLine, queryTime, queryWarehouse, tbItemWipEntity.Text, taskString, ref _ynPage, ref message); if (!string.IsNullOrEmpty(jsonString)) { list = (List <AscmWipDiscreteJobs>)JsonConvert.DeserializeObject(jsonString, typeof(List <AscmWipDiscreteJobs>)); if (list != null && list.Count > 0) { ynPage = (YnBaseDal.YnPage)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnBaseDal.YnPage), _ynPage); count = ynPage.GetRecordCount(); } } } catch (Exception ex) { throw ex; } return(list); }