bool frm_CommonProcessSubmit(CustomFlowForm form, string advise) { FM_InstitutionProcess lnqProcess = (FM_InstitutionProcess)form.ResultInfo; if (!CheckData(lnqProcess)) { return(false); } MessageDialog.ShowPromptMessage("请选择相关部门"); FormDataTableCheck frmCheck = new FormDataTableCheck(UniversalFunction.GetAllDeptInfo()); if (frmCheck.ShowDialog() == DialogResult.OK) { List <string> list = DataSetHelper.ColumnsToList_Distinct(frmCheck._DtResult, "部门代码"); if (!m_serverInstitution.AddInfo(lnqProcess, list, out m_strErr)) { MessageDialog.ShowPromptMessage(m_strErr); return(false); } } else { MessageDialog.ShowPromptMessage("请选择相关部门"); return(false); } return(true); }
private void btnCourse_Click(object sender, EventArgs e) { if (cmbYearValue.Text.Trim().Length == 0) { MessageDialog.ShowPromptMessage("请选择【培训年份】"); return; } FormDataTableCheck frm = new FormDataTableCheck(_ServiceCollect.GetCourseInfo(Convert.ToInt32(cmbYearValue.Text))); frm._BlDateTimeControlShow = false; frm._BlIsCheckBox = false; if (frm.ShowDialog() == DialogResult.OK) { int courseID = Convert.ToInt32(frm._DtResult.Rows[0]["课程ID"]); View_HR_Train_Course courseInfo = _ServiceBasic.GetSingleCourseInfo(courseID); if (courseInfo != null) { chbIsOutSide.Checked = (bool)courseInfo.外训; txtClassHour.Text = courseInfo.预计课时.ToString(); txtLecturer.Text = courseInfo.推荐讲师; numFund.Value = (decimal)courseInfo.预计经费; txtCourse.Text = courseInfo.课程名; txtCourse.Tag = courseInfo.课程ID; btnCourse.Tag = frm._DtResult.Rows[0]["ID"].ToString(); } } }
private void btnShortcutSelect_Click(object sender, EventArgs e) { DataTable tempTable = m_serverThreePacketsOfTheRepair.GetShortcutDetail(m_lnqBill.ProductType); FormDataTableCheck fdc = new FormDataTableCheck(tempTable); if (fdc.ShowDialog() == DialogResult.OK) { List <View_YX_ThreePacketsOfTheRepairList> tempList = m_serverThreePacketsOfTheRepair.GetShortcutDetailList(fdc._DtResult, out m_strErr); if (m_strErr != null && m_strErr.Trim().Length > 0) { MessageDialog.ShowPromptMessage(m_strErr + "库存不足"); } if (tempList != null) { DataTable dt = (DataTable)dataGridView1.DataSource; foreach (View_YX_ThreePacketsOfTheRepairList item in tempList) { bool flag = false; for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["物品ID"].ToString() == item.物品ID.ToString() && dt.Rows[i]["批次号"].ToString() == item.批次号) { dt.Rows[i]["领用数量"] = Convert.ToDecimal(dt.Rows[i]["领用数量"]) + Convert.ToDecimal(item.领用数量); flag = true; break; } } if (!flag) { DataRow dr = dt.NewRow(); dr["图号型号"] = item.图号型号; dr["物品名称"] = item.物品名称; dr["规格"] = item.规格; dr["批次号"] = item.批次号; dr["领用数量"] = item.领用数量; dr["单位"] = item.单位; dr["单价"] = item.单价; dr["金额"] = item.金额; dr["策略金额"] = item.策略金额; dr["备注"] = item.备注; dr["物品ID"] = item.物品ID; dr["单据号"] = m_lnqBill.Bill_ID; dr["是否为客户责任"] = item.是否为客户责任; dt.Rows.Add(dr); } } RefreshInfo(dt); } } }
private void btnBatchCreate_Click(object sender, EventArgs e) { FormDataTableCheck frm = new FormDataTableCheck(m_goodsServer.GetBatchCreatList("领料", ServerTime.Time.AddDays(-20), ServerTime.Time)); frm.OnFormDataTableCheckFind += new GlobalObject.DelegateCollection.FormDataTableCheckFindDelegate(frm_OnFormDataTableCheckFind1); frm._BlDateTimeControlShow = true; if (frm.ShowDialog() == DialogResult.OK) { string strBillIDGather = ""; foreach (DataRow dr in frm._DtResult.Rows) { strBillIDGather += "'" + dr["领料单号"].ToString() + "',"; } strBillIDGather = "(" + strBillIDGather.Remove(strBillIDGather.Length - 1) + ")"; if (!m_goodsServer.BatchCreateList("领料", m_billNo, strBillIDGather, out m_error)) { MessageDialog.ShowPromptMessage(m_error); } else { MessageDialog.ShowPromptMessage("生成成功"); this.Close(); } m_queryGoodsInfo = m_goodsServer.GetGoods(m_billNo); RefreshDataGridView(m_queryGoodsInfo); } }
private void btnGreenLight_Click(object sender, EventArgs e) { string error = null; Hashtable hsTable = new Hashtable(); hsTable.Add("@BillNo", dgv_Show.CurrentRow.Cells["DJH"].Value.ToString()); DataTable tempTable = GlobalObject.DatabaseServer.QueryInfoPro("S_Marketing_GreenLightInfo", hsTable, out error); FormDataTableCheck frm = new FormDataTableCheck(tempTable); if (frm.ShowDialog() == DialogResult.OK) { if (frm._DtResult != null && frm._DtResult.Rows.Count > 0) { List <ProductsCode_GreenLight> lstInfo = new List <ProductsCode_GreenLight>(); foreach (DataRow dr in frm._DtResult.Rows) { ProductsCode_GreenLight tempInfo = new ProductsCode_GreenLight(); tempInfo.F_Id = Guid.NewGuid().ToString(); tempInfo.UserID = BasicInfo.LoginID; tempInfo.CreateTime = ServerTime.Time; tempInfo.GoodsID = Convert.ToInt32(dr["物品ID"]); tempInfo.ProductCode = dr["箱号"].ToString(); lstInfo.Add(tempInfo); } m_findSellIn.AddList_ProductCodesGreenLight(lstInfo); } } }
private void btnCollect_Click(object sender, EventArgs e) { try { if (cmbYear.Text.Trim().Length == 0) { throw new Exception("请选择【计划年份】"); } FormDataTableCheck frm = new FormDataTableCheck(_ServiceSurvey.GetBillInfo_Year(Convert.ToInt32(cmbYear.Text))); frm._BlDateTimeControlShow = false; frm._BlIsCheckBox = true; if (frm.ShowDialog() == DialogResult.OK) { if (frm._DtResult != null && frm._DtResult.Rows.Count > 0) { List <string> lstBillNo = DataSetHelper.ColumnsToList_Distinct(frm._DtResult, "单据号"); _ServiceCollect.GenerateCollectPlan_Year(lstBillNo, Convert.ToInt32(cmbYear.Text)); RefreshViewCourse(CE_HR_Train_PlanType.年度培训计划, Convert.ToInt32(cmbYear.Text), null); } } } catch (Exception ex) { MessageDialog.ShowPromptMessage(ex.Message); } }
private void btnSelectDepartment_Click(object sender, EventArgs e) { IDepartmentServer service = ServerModule.ServerModuleFactory.GetServerModule <IDepartmentServer>(); DataTable dtTemp = new DataTable(); dtTemp.Columns.Add("部门编码"); if (txtApplicableDepartment.Text.Trim().Length > 0) { foreach (string str in txtApplicableDepartment.Tag.ToString().Split(',').ToList()) { DataRow dr = dtTemp.NewRow(); dr["部门编码"] = str; dtTemp.Rows.Add(dr); } } List <string> lstTemp = new List <string>(); lstTemp.Add("部门编码"); FormDataTableCheck frm = new FormDataTableCheck(service.GetDepartment_Finance(), dtTemp, lstTemp); frm._BlDateTimeControlShow = false; frm._BlIsCheckBox = true; if (frm.ShowDialog() == DialogResult.OK) { txtApplicableDepartment.Text = ""; txtApplicableDepartment.Tag = ""; foreach (DataRow dr in frm._DtResult.Rows) { txtApplicableDepartment.Text += dr["部门名称"].ToString() + ","; txtApplicableDepartment.Tag += dr["部门编码"].ToString() + ","; } if (txtApplicableDepartment.Text.Trim().Length > 0) { txtApplicableDepartment.Text = txtApplicableDepartment.Text.Substring(0, txtApplicableDepartment.Text.Length - 1); txtApplicableDepartment.Tag = txtApplicableDepartment.Tag.ToString().Substring(0, txtApplicableDepartment.Tag.ToString().Length - 1); } } }
private void btnBenchCreate_Click(object sender, EventArgs e) { try { if (cmbBillType.Text.Trim().Length > 0) { DataTable dataSource = m_serviceOutPut.GetReferenceInfo(cmbBillType.Text, txtApplyingDepartment.Tag == null ? null : txtApplyingDepartment.Tag.ToString(), chbIsRepeat.Checked); FormDataTableCheck frm = new FormDataTableCheck(dataSource); frm._BlDateTimeControlShow = false; if (frm.ShowDialog() == DialogResult.OK) { List <string> listTemp = DataSetHelper.ColumnsToList_Distinct(frm._DtResult, "单据号"); string deptCode = ""; m_listViewDetail = m_serviceOutPut.GetReferenceListViewDetail(txtBillNo.Text, listTemp, chbIsRepeat.Checked, out deptCode); if (m_listViewDetail != null) { txtApplyingDepartment.Text = UniversalFunction.GetDeptName(deptCode); txtApplyingDepartment.Tag = deptCode; List <Business_WarehouseOutPut_Requisition> listRequisition = m_serviceRequistion.GetListBillInfo(m_listViewDetail.Select(k => k.关联业务).Distinct().ToList()); cmbTypeDetail.DataSource = listRequisition.Select(k => k.BillTypeDetail).Distinct().ToList(); m_serverProductCode.InsertChangeProductCodesBillNo(listRequisition.Select(k => k.BillNo).ToList(), txtBillNo.Text); customDataGridView1.Rows.Clear(); RefreshDataGridView(m_listViewDetail); } } cmbBillType.Enabled = customDataGridView1.Rows.Count > 0 ? false : true; } else { MessageDialog.ShowPromptMessage("请选择【业务类型】"); return; } } catch (Exception ex) { MessageDialog.ShowPromptMessage(ex.Message); } }
private void btnSetUser_Click(object sender, EventArgs e) { if (txtCourse.Text.Trim().Length == 0) { MessageDialog.ShowPromptMessage("请选择【课程】"); return; } FormDataTableCheck frm = new FormDataTableCheck(_ServiceCollect.GetUserInfo(btnCourse.Tag.ToString())); frm._BlDateTimeControlShow = false; frm._BlIsCheckBox = true; if (frm.ShowDialog() == DialogResult.OK) { List <string> lstWork = DataSetHelper.ColumnsToList_Distinct(frm._DtResult, "工号"); btnSetUser.Tag = lstWork; } }
private void btn_PostRel_Set_Click(object sender, EventArgs e) { DataTable sourceTable = new DataTable(); DataTable checkTable = new DataTable(); List <string> lstkeys = new List <string>(); if (rb_PostRel_CourseToPost.Checked) { sourceTable = _ServiceBasicInfo.GetPostInfo(null); checkTable = (DataTable)dgv_PostRel_Post.DataSource; lstkeys.Add("岗位编号"); FormDataTableCheck frm = new FormDataTableCheck(sourceTable, checkTable, lstkeys); frm._BlDateTimeControlShow = false; frm._BlIsCheckBox = true; if (frm.ShowDialog() == DialogResult.OK) { _ServiceBasicInfo.Operation_PostRelation_CourseToPost(frm._DtResult, Convert.ToInt32(dgv_PostRel_Course.CurrentRow.Cells["课程ID4"].Value)); dgv_PostRel_Course_CellEnter(null, null); } } else if (rb_PostRel_PostToCourse.Checked) { sourceTable = _ServiceBasicInfo.GetCourseInfo(null); checkTable = (DataTable)dgv_PostRel_Course.DataSource; lstkeys.Add("课程ID"); FormDataTableCheck frm = new FormDataTableCheck(sourceTable, checkTable, lstkeys); frm._BlDateTimeControlShow = false; frm._BlIsCheckBox = true; if (frm.ShowDialog() == DialogResult.OK) { _ServiceBasicInfo.Operation_PostRelation_PostToCourse(frm._DtResult, Convert.ToInt32(dgv_PostRel_Post.CurrentRow.Cells["岗位编号"].Value)); dgv_PostRel_Post_CellEnter(null, null); } } }
private void btnSel_Click(object sender, EventArgs e) { Dictionary <CE_GoodsAttributeName, string> dic = new Dictionary <CE_GoodsAttributeName, string>(); dic.Add(CE_GoodsAttributeName.自制件, "True"); IEnumerable <F_GoodsPlanCost> iEnum = UniversalFunction.GetGoodsInfoList_Attribute(dic); DepotManagementDataContext ctx = CommentParameter.DepotDataContext; IQueryable iq = (from a in ctx.View_F_GoodsPlanCost where iEnum.Select(k => k.ID).ToList().Contains(a.序号) select a).AsQueryable <View_F_GoodsPlanCost>(); DataTable tempTable = GlobalObject.GeneralFunction.ConvertToDataTable(iq); List <string> lstKeys = new List <string>(); lstKeys.Add("序号"); FormDataTableCheck frm = new FormDataTableCheck(tempTable, _ApplicableGoods, lstKeys); if (frm.ShowDialog() == DialogResult.OK) { _ApplicableGoods = frm._DtResult; txtApplyToProductCode.Text = ""; txtApplyToProductName.Text = ""; foreach (DataRow dr in _ApplicableGoods.Rows) { txtApplyToProductCode.Text += dr["图号型号"].ToString() + "、"; txtApplyToProductName.Text += dr["物品名称"].ToString() + "、"; } txtApplyToProductCode.Text = txtApplyToProductCode.Text.Substring(0, txtApplyToProductCode.Text.Length - 1); txtApplyToProductName.Text = txtApplyToProductName.Text.Substring(0, txtApplyToProductName.Text.Length - 1); } }
private void btnBenchCreate_Click(object sender, EventArgs e) { try { if (cmbBillType.Text.Trim().Length > 0) { switch (GlobalObject.GeneralFunction.StringConvertToEnum <CE_InPutBusinessType>(cmbBillType.Text)) { case CE_InPutBusinessType.生产采购: case CE_InPutBusinessType.普通采购: case CE_InPutBusinessType.委外采购: case CE_InPutBusinessType.样品采购: IQueryable <View_B_OrderFormInfo> findOrderFormInfo; IOrderFormInfoServer orderFormServer = ServerModule.ServerModuleFactory.GetServerModule <IOrderFormInfoServer>(); if (!orderFormServer.GetAllOrderFormInfo(BasicInfo.ListRoles, BasicInfo.LoginID, out findOrderFormInfo, out m_strError)) { MessageDialog.ShowErrorMessage(m_strError); return; } DataTable dataSource = GlobalObject.GeneralFunction.ConvertToDataTable <View_B_OrderFormInfo>(findOrderFormInfo); FormDataTableCheck frm = new FormDataTableCheck(dataSource); frm._BlDateTimeControlShow = false; if (frm.ShowDialog() == DialogResult.OK) { List <string> listTemp = DataSetHelper.ColumnsToList_Distinct(frm._DtResult, "订单号"); m_listViewDetail = m_serviceRequistion.GetListViewDetail_OrderForm(txtBillNo.Text, listTemp); RefreshDataGridView(m_listViewDetail); } foreach (DataGridViewRow dgvr in customDataGridView1.Rows) { ((DataGridViewTextBoxShowCell)dgvr.Cells["图号型号"]).m_EndSql = " and 序号 in ( select GoodsID from B_OrderFormGoods where OrderFormNumber = '" + dgvr.Cells["关联业务"].Value.ToString() + "')"; ((DataGridViewTextBoxShowCell)dgvr.Cells["批次号"]).ReadOnly = true; ((DataGridViewTextBoxShowCell)dgvr.Cells["供应商"]).ReadOnly = true; } break; default: break; } cmbBillType.Enabled = customDataGridView1.Rows.Count > 0 ? false : true; } else { MessageDialog.ShowPromptMessage("请选择【业务类型】"); return; } } catch (Exception ex) { MessageDialog.ShowPromptMessage(ex.Message); return; } }
private void btnMaterialsTransfer_Click(object sender, EventArgs e) { if (m_lnqWSCode == null) { return; } FormDataTableCheck frm = new FormDataTableCheck(m_serverMaterials.GetMaterialsTransferInfo(m_lnqWSCode.WSCode)); frm.OnFormDataTableCheckFind += new GlobalObject.DelegateCollection.FormDataTableCheckFindDelegate(frm_OnFormDataTableCheckFind); frm._BlDateTimeControlShow = true; if (frm.ShowDialog() == DialogResult.OK) { List <string> listRequisition = DataSetHelper.ColumnsToList_Distinct(frm._DtResult, "单据号"); DataTable tempTable = m_serverMaterials.SumMaterialsTransferGoods(listRequisition, (int)CE_SubsidiaryOperationType.物料转换后, (int)CE_SubsidiaryOperationType.领料退库, m_lnqWSCode.WSCode); foreach (DataRow dr in tempTable.Rows) { S_MaterialListReturnedInTheDepot goods = new S_MaterialListReturnedInTheDepot(); goods.Bill_ID = m_billNo; goods.GoodsID = Convert.ToInt32(dr["物品ID"]); StoreQueryCondition condition = new StoreQueryCondition(); condition.GoodsID = Convert.ToInt32(txtCode.Tag); condition.BatchNo = dr["批次号"].ToString(); condition.StorageID = m_strStorage; S_Stock tempStock = m_serverStock.GetStockInfo(condition); if (tempStock != null) { goods.Provider = tempStock.Provider; goods.ProviderBatchNo = tempStock.ProviderBatchNo; } else { goods.Provider = ""; goods.ProviderBatchNo = ""; } goods.BatchNo = dr["批次号"].ToString(); goods.ReturnedAmount = Convert.ToDecimal(dr["数量"]); goods.Remark = txtRemark.Text; goods.ShelfArea = ""; goods.ColumnNumber = ""; goods.LayerNumber = ""; //产品状态 设置 2012.3.30 by cjb if (cmbProductStatus.Text.Trim() != "") { if (cmbProductStatus.Text.Trim() == "已返修") { goods.RepairStatus = true; } else { goods.RepairStatus = false; } } if (!m_goodsServer.AddGoods(goods, out m_error)) { MessageDialog.ShowErrorMessage(m_error); return; } } m_queryGoodsInfo = m_goodsServer.GetGoods(m_billNo); RefreshDataGridView(m_queryGoodsInfo); } }
private void btnInputAccountInfo_Click(object sender, EventArgs e) { if (txtSettlementCompany.Text.Trim().Length == 0) { MessageBox.Show("请选择【结算单位】"); return; } DataTable dtTemp = _Service_Account.LeadInputAccount(txtSettlementCompany.Tag.ToString()); DataTable tempTable = new DataTable(); List <string> lstKeys = new List <string>(); lstKeys.Add("挂账年月"); lstKeys.Add("物品ID"); foreach (string keysName in lstKeys) { tempTable.Columns.Add(keysName); } foreach (DataGridViewRow dgvr in customDataGridView1.Rows) { DataRow drNew = tempTable.NewRow(); drNew["挂账年月"] = dgvr.Cells["挂账年月"].Value.ToString(); drNew["物品ID"] = Convert.ToInt32(dgvr.Cells["GoodsID"].Value); tempTable.Rows.Add(drNew); } FormDataTableCheck frm = new FormDataTableCheck(dtTemp, tempTable, lstKeys); if (frm.ShowDialog() == DialogResult.OK) { if (frm._DtResult == null) { return; } foreach (DataRow dr in frm._DtResult.Rows) { bool flag = false; foreach (DataGridViewRow dgvr in customDataGridView1.Rows) { if (dgvr.Cells["GoodsID"].Value.ToString() == dr["物品ID"].ToString() && dgvr.Cells["挂账年月"].Value.ToString() == dr["挂账年月"].ToString()) { flag = true; break; } } if (!flag) { decimal price = Math.Round((decimal)dr["协议单价"] / (1 + Convert.ToDecimal(dr["税率"]) / 100) * (decimal)dr["应挂数量"], 2); View_F_GoodsPlanCost goodsInfo = UniversalFunction.GetGoodsInfo((int)dr["物品ID"]); customDataGridView1.Rows.Add(new object[] { dr["图号型号"].ToString(), dr["物品名称"].ToString(), dr["规格"].ToString(), dr["挂账年月"].ToString(), (decimal)dr["协议单价"], (int)dr["税率"], goodsInfo.单位, (decimal)dr["应挂数量"], (decimal)dr["应挂数量"], price, price, "", txtBillNo.Text, (int)dr["物品ID"] }); } } } SumPrice(); }