/// <summary> /// 赋值账务信息 /// </summary> /// <param name="dataContext">数据上下文</param> /// <param name="bill">单据信息</param> /// <returns>返回账务信息对象</returns> public S_InDepotDetailBill AssignDetailInfo(DepotManagementDataContext dataContext, S_CheckOutInDepotBill bill) { View_HR_Personnel personnel = UniversalFunction.GetPersonnelInfo(dataContext, bill.DeclarePersonnelCode); S_InDepotDetailBill detailBill = new S_InDepotDetailBill(); detailBill.ID = Guid.NewGuid(); detailBill.BillTime = (DateTime)bill.InDepotTime; detailBill.FillInPersonnel = bill.DeclarePersonnel; detailBill.Department = personnel.部门名称; detailBill.FactPrice = Math.Round(Convert.ToDecimal(bill.InDepotCount) * bill.UnitPrice, 2); detailBill.FactUnitPrice = bill.UnitPrice; detailBill.GoodsID = bill.GoodsID; detailBill.BatchNo = bill.BatchNo; detailBill.InDepotBillID = bill.Bill_ID; detailBill.InDepotCount = bill.InDepotCount; detailBill.Price = Math.Round(Convert.ToDecimal(bill.InDepotCount) * bill.UnitPrice, 2); detailBill.UnitPrice = bill.UnitPrice; detailBill.OperationType = (int)CE_SubsidiaryOperationType.报检入库; detailBill.Provider = bill.Provider; detailBill.StorageID = bill.StorageID; detailBill.FillInDate = bill.Bill_Time; detailBill.AffrimPersonnel = bill.DepotManager; return(detailBill); }
/// <summary> /// 赋值账务信息 /// </summary> /// <param name="ctx">数据上下文</param> /// <param name="bill">单据信息</param> /// <param name="item">明细信息</param> /// <returns>返回账务信息</returns> S_InDepotDetailBill AssignDetailInfo(DepotManagementDataContext ctx, S_FrockInDepotBill bill, S_FrockInDepotGoodsBill item) { IPersonnelInfoServer serverPersonnelInfo = ServerModuleFactory.GetServerModule <IPersonnelInfoServer>(); View_HR_Personnel lnqPersonnel = UniversalFunction.GetPersonnelInfo(ctx, bill.JJRYID); S_InDepotDetailBill lnqDetailBill = new S_InDepotDetailBill(); View_F_GoodsPlanCost lnqBasicGoodsInfo = UniversalFunction.GetGoodsInfo(ctx, item.GoodsID); lnqDetailBill.ID = Guid.NewGuid(); lnqDetailBill.BillTime = (DateTime)bill.InDepotDate; lnqDetailBill.FillInPersonnel = lnqPersonnel.姓名; lnqDetailBill.Department = lnqPersonnel.部门名称; lnqDetailBill.FactPrice = 0; lnqDetailBill.FactUnitPrice = 0; lnqDetailBill.GoodsID = item.GoodsID; lnqDetailBill.BatchNo = item.BatchNo; lnqDetailBill.InDepotBillID = bill.Bill_ID; lnqDetailBill.InDepotCount = item.Amount; lnqDetailBill.Price = 0; lnqDetailBill.UnitPrice = 0; lnqDetailBill.OperationType = (int)CE_SubsidiaryOperationType.自制件工装入库; lnqDetailBill.Provider = bill.Provider; lnqDetailBill.StorageID = bill.StorageID; lnqDetailBill.AffrimPersonnel = bill.DepotManager; lnqDetailBill.FillInDate = bill.Bill_Time; return(lnqDetailBill); }
/// <summary> /// 赋值账务信息 /// </summary> /// <param name="dataContext">数据上下文</param> /// <param name="bill">单据信息</param> /// <param name="item">明细信息</param> /// <returns>返回账务信息</returns> public S_InDepotDetailBill AssignDetailInfo(DepotManagementDataContext dataContext, S_OrdinaryInDepotBill bill, S_OrdinaryInDepotGoodsBill item) { IPersonnelInfoServer personnelServer = ServerModuleFactory.GetServerModule <IPersonnelInfoServer>(); S_InDepotDetailBill detailBill = new S_InDepotDetailBill(); View_HR_Personnel personnel = UniversalFunction.GetPersonnelInfo(dataContext, bill.BuyerCode); View_F_GoodsPlanCost basicGoodsInfo = UniversalFunction.GetGoodsInfo(dataContext, item.GoodsID); detailBill.ID = Guid.NewGuid(); detailBill.BillTime = (DateTime)bill.InDepotDate; detailBill.FillInPersonnel = personnel.姓名; detailBill.Department = personnel.部门名称; detailBill.FactPrice = Math.Round((item.UnitPrice * (decimal)item.Amount), 2); detailBill.FactUnitPrice = item.UnitPrice; detailBill.GoodsID = item.GoodsID; detailBill.BatchNo = item.BatchNo; detailBill.InDepotBillID = bill.Bill_ID; detailBill.InDepotCount = item.Amount; detailBill.Price = Math.Round((item.UnitPrice * (decimal)item.Amount), 2); detailBill.UnitPrice = item.UnitPrice; detailBill.OperationType = (int)GlobalObject.CE_SubsidiaryOperationType.普通入库; detailBill.Provider = bill.Provider; detailBill.StorageID = bill.StorageID; detailBill.AffrimPersonnel = UniversalFunction.GetPersonnelInfo(bill.DepotManager).姓名; detailBill.FillInDate = bill.Bill_Time; return(detailBill); }
/// <summary> /// 工具账务操作 /// </summary> /// <param name="ctx">数据上下文</param> /// <param name="billNo">单据号</param> /// <param name="goodsID">物品ID</param> /// <param name="provider">供应商</param> /// <param name="operationCount">操作数量</param> /// <param name="workID">操作人员ID</param> void ToolsOperation(DepotManagementDataContext ctx, string billNo, int goodsID, string provider, decimal operationCount, string workID) { IToolsManage serverTools = ServerModule.ServerModuleFactory.GetServerModule <IToolsManage>(); if (serverTools.IsTools(goodsID)) { Service_Manufacture_WorkShop.IWorkShopBasic serverWSBasic = Service_Manufacture_WorkShop.ServerModuleFactory.GetServerModule <Service_Manufacture_WorkShop.IWorkShopBasic>(); IPersonnelInfoServer serverPersonnel = ServerModuleFactory.GetServerModule <IPersonnelInfoServer>(); View_HR_Personnel viewPersonnel = serverPersonnel.GetPersonnelInfo(workID); WS_WorkShopCode tempWSCode = serverWSBasic.GetPersonnelWorkShop(workID); S_MachineAccount_Tools toolsInfo = new S_MachineAccount_Tools(); toolsInfo.GoodsID = goodsID; toolsInfo.Provider = provider; toolsInfo.StockCount = -operationCount; if (tempWSCode != null) { toolsInfo.StorageCode = tempWSCode.WSCode; } else { toolsInfo.StorageCode = viewPersonnel.部门编码; } serverTools.OpertionInfo(ctx, toolsInfo); serverTools.DayToDayAccount(ctx, toolsInfo, billNo); } }
/// <summary> /// 界面初始化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void 营销出库明细单_Load(object sender, EventArgs e) { DataTable dt = m_findSellIn.GetBill(m_strDJH, m_intDJID); m_drZdCK = dt.NewRow(); if (m_intDJID != 0) { m_strDJZTFlag = dt.Rows[0]["DJZT_Flag"].ToString(); View_HR_Personnel lnqPersonnel = m_findPersonnel.GetPersonnelInfo(dt.Rows[0]["LRRY"].ToString()); lbUserName.Text = lnqPersonnel.姓名.ToString(); lbUserName.Tag = lnqPersonnel.工号.ToString(); lbKS.Text = lnqPersonnel.部门名称.ToString(); lbKS.Tag = lnqPersonnel.部门编码.ToString(); m_dtMxCK = m_findSellIn.GetList(m_intDJID); tbsClient.Tag = dt.Rows[0]["ObjectDept"].ToString(); txtSellID.Text = dt.Rows[0]["DJH"].ToString(); tbsClient.Text = m_findClientServer.GetClientName(dt.Rows[0]["ObjectDept"].ToString()); cmbCKFS.Text = dt.Rows[0]["YWFS"].ToString(); txtRemarkAll.Text = dt.Rows[0]["Remark"].ToString(); cmbStorage.Text = UniversalFunction.GetStorageName(dt.Rows[0]["StorageID"].ToString()); } else { m_strDJZTFlag = "已保存"; lbUserName.Text = BasicInfo.LoginName; lbUserName.Tag = BasicInfo.LoginID; lbKS.Text = BasicInfo.DeptName; lbKS.Tag = BasicInfo.DeptCode; txtSellID.Text = m_billNoControl.GetNewBillNo(); CreateDateTableStyle(); } if (m_strDJZTFlag != "已保存" && m_strDJZTFlag != "") { cmbCKFS.Enabled = false; tbsClient.Enabled = false; cmbStorage.Enabled = false; if (UniversalFunction.CheckStorageAndPersonnel(dt.Rows[0]["StorageID"].ToString()) == false) { btnAffirm.Visible = false; } } dgv_Main.DataSource = m_dtMxCK; m_strDJH = txtSellID.Text.Trim(); dgv_Main.Columns["SellUnitPrice"].Visible = false; dgv_Main.Columns["UnitPrice"].Visible = false; dgv_Main.Columns["Price"].Visible = false; }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (dataGridView1.CurrentRow == null) { return; } txtName.Tag = dataGridView1.CurrentRow.Cells["F_Id"].Value.ToString(); txtName.Text = dataGridView1.CurrentRow.Cells["物品名称"].Value.ToString(); txtSpce.Text = dataGridView1.CurrentRow.Cells["规格"].Value.ToString(); txtCode.Text = dataGridView1.CurrentRow.Cells["图号型号"].Value.ToString(); txtCode.Tag = Convert.ToInt32(dataGridView1.CurrentRow.Cells["物品ID"].Value); txtGaugeCoding.Text = dataGridView1.CurrentRow.Cells["量检具编号"].Value.ToString(); txtManufacturer.Text = dataGridView1.CurrentRow.Cells["制造商"].Value.ToString(); object workID = dataGridView1.CurrentRow.Cells["DutyUser"].Value; if (workID != null) { View_HR_Personnel personnel = UniversalFunction.GetPersonnelInfo(workID.ToString()); txtDutyUser.Text = personnel.姓名; txtDutyUser.Tag = personnel.工号; txtDept.Text = personnel.部门名称; } else { txtDutyUser.Text = ""; txtDutyUser.Tag = null; txtDept.Text = null; } txtRemark.Text = dataGridView1.CurrentRow.Cells["备注"].Value.ToString(); numValidity.Value = Convert.ToDecimal(dataGridView1.CurrentRow.Cells["校准周期"].Value.ToString()); dtpMaterialDate.Value = GeneralFunction.IsNullOrEmpty(dataGridView1.CurrentRow.Cells["领用日期"].Value.ToString()) ? ServerTime.Time : Convert.ToDateTime(dataGridView1.CurrentRow.Cells["领用日期"].Value); txtEffectiveDate.Text = dataGridView1.CurrentRow.Cells["有效日期"].Value.ToString(); dtpInputDate.Value = dataGridView1.CurrentRow.Cells["入库时间"].Value == DBNull.Value ? ServerTime.Time : Convert.ToDateTime(dataGridView1.CurrentRow.Cells["入库时间"].Value); chbZK.Checked = Convert.ToBoolean(dataGridView1.CurrentRow.Cells["在库"].Value); chbBF.Checked = Convert.ToBoolean(dataGridView1.CurrentRow.Cells["报废"].Value); cmbGaugeType.Text = dataGridView1.CurrentRow.Cells["量检具类别"].Value.ToString(); txtFactoryNo.Text = dataGridView1.CurrentRow.Cells["出厂编号"].Value.ToString(); cmbCheckType.Text = dataGridView1.CurrentRow.Cells["校准类别"].Value.ToString(); }
private void 库房调拨明细单_Load(object sender, EventArgs e) { S_CannibalizeBill tempBillInfo = new S_CannibalizeBill(); if (m_intDJID != 0) { tempBillInfo = m_serverCannibalize.GetBill(m_intDJID); m_strDJZTFlag = tempBillInfo.DJZT; View_HR_Personnel lnqPersonnel = m_findPersonnel.GetPersonnelInfo(tempBillInfo.LRRY); if (lnqPersonnel.姓名 != BasicInfo.LoginName) { btnSave.Visible = false; cmbInStorage.Enabled = false; cmbOutStorage.Enabled = false; } m_dtMxCK = m_serverCannibalize.GetList(m_intDJID); txtSellID.Text = tempBillInfo.DJH; txtPrice.Text = tempBillInfo.Price.ToString(); txtRemarkAll.Text = tempBillInfo.Remark; cmbInStorage.Text = UniversalFunction.GetStorageName(tempBillInfo.InStoreRoom); cmbOutStorage.Text = UniversalFunction.GetStorageName(tempBillInfo.OutStoreRoom); btnAffirm.Visible = UniversalFunction.CheckStorageAndPersonnel(tempBillInfo.OutStoreRoom); } else { m_strDJZTFlag = "已保存"; btnAffirm.Visible = false; txtSellID.Text = m_billNoControl.GetNewBillNo(); CreateDateTableStyle(); } if (m_strDJZTFlag != "已保存" && m_strDJZTFlag != "") { cmbOutStorage.Enabled = false; cmbInStorage.Enabled = false; if (!UniversalFunction.CheckStorageAndPersonnel(tempBillInfo.OutStoreRoom) == false) { btnSh.Visible = false; } } dgv_Main.DataSource = m_dtMxCK; m_strDJH = txtSellID.Text.Trim(); }
/// <summary> /// 点击选择按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSelectField_Click(object sender, EventArgs e) { int index = 0; m_selectedUser = new List <View_HR_Personnel>(); foreach (DataGridViewRow item in dataGridView.Rows) { if ((bool)item.Cells[0].Value) { View_HR_Personnel user = (from r in m_lstAllUser where r.工号 == item.Cells[1].Value.ToString() select r).Single(); m_selectedUser.Add(user); } index++; } this.DialogResult = DialogResult.OK; }
private void 提交整改措施信息ToolStripMenuItem_Click(object sender, EventArgs e) { if (dataGridView1.CurrentRow.Cells["单据状态"].Value.ToString() == "等待整改措施") { if (!UpdateBill()) { return; } string msg = string.Format("{0} 号质量问题整改处置单已提交整改措施,请责任部门确认整改措施", m_lnqQuality.Bill_ID); View_HR_Personnel lnqViewPersonnel = m_serverPersonnel.GetDeptDirector(m_serverDepartment.GetDepartmentCode(m_lnqQuality.RelevantDepartment)).First(); m_billMessageServer.PassFlowMessage(m_lnqQuality.Bill_ID, msg, lnqViewPersonnel.工号, false); } else { MessageDialog.ShowErrorMessage("请重新确认单据状态"); } }
private void customDataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (customDataGridView1.CurrentRow == null) { return; } txtKeyPointName.Tag = customDataGridView1.CurrentRow.Cells["F_Id"].Value; Bus_FocalWork_KeyPoint keyPoint = _Service_FocalWork.GetSingle_KeyPoint(txtKeyPointName.Tag.ToString()); View_HR_Personnel personnel = UniversalFunction.GetPersonnelInfo(keyPoint.DutyUser); txtDutyUser.Text = personnel.姓名; txtDutyUser.Tag = personnel.工号; txtKeyPointName.Text = keyPoint.KeyPointName; dtpStartDate.Value = (DateTime)keyPoint.StartDate; dtpEndDate.Value = (DateTime)keyPoint.EndDate; }
/// <summary> /// 获取职员信息 /// </summary> /// <param name="info">工号/姓名</param> /// <returns>返回获取到的职员信息, 获取不到返回null</returns> public View_HR_Personnel GetPersonnelInfo(string info) { DepotManagementDataContext dataContxt = CommentParameter.DepotDataContext; var result = from r in dataContxt.View_HR_Personnel where r.工号 == info || r.姓名 == info select r; View_HR_Personnel resultLnq = null; if (result.Count() > 0) { resultLnq = result.First(); if (result.Count() > 1) { var tempDelete = from a in result where a.DeleteFlag == false select a; resultLnq = tempDelete.First(); if (tempDelete.Count() > 1) { var tempOperation = from a in tempDelete where a.是否操作用户 == true select a; resultLnq = tempOperation.First(); } } return(resultLnq); } else { return(null); } }
private void 重点工作关键节点_Load(object sender, EventArgs e) { if (_Table_Source != null && _Table_Source.Rows.Count > 0) { customDataGridView1.DataSource = _Table_Source; customDataGridView1.ReadOnly = true; } else if (_List_KeyPoint != null && _List_KeyPoint.Count() > 0) { this.状态.Items.Remove("待启动"); this.状态.Items.Remove("进行中"); foreach (Bus_FocalWork_MonthlyProgress_KeyPoint item in _List_KeyPoint) { Bus_FocalWork_KeyPoint keyPoint = _Service_FocalWork.GetSingle_KeyPoint(item.KeyPointId); View_HR_Personnel personnel = UniversalFunction.GetPersonnelInfo(keyPoint.DutyUser); customDataGridView1.Rows.Add(new object[] { keyPoint.KeyPointName, item.Evaluate, keyPoint.StartDate, keyPoint.EndDate, personnel.姓名, item.F_Id }); } } }
private void customDataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (customDataGridView1.CurrentRow == null) { return; } txtTaskName.Tag = customDataGridView1.CurrentRow.Cells["F_Id"].Value; Bus_FocalWork focalWork = _Service_FocalWork.GetSingle_FocalWork(txtTaskName.Tag.ToString()); View_HR_Personnel personnel = UniversalFunction.GetPersonnelInfo(focalWork.DutyUser); txtDutyUser.Text = personnel.姓名; txtDutyUser.Tag = personnel.工号; txtTaskDescription.Text = focalWork.TaskDescription; txtExpectedGoal.Text = focalWork.ExpectedGoal; txtTaskName.Text = focalWork.TaskName; dtpStartDate.Value = (DateTime)focalWork.StartDate; dtpEndDate.Value = (DateTime)focalWork.EndDate; }
/// <summary> /// 确认单据 /// </summary> /// <param name="billNo">单据号</param> /// <param name="list">明细信息</param> /// <param name="error">错误信息</param> /// <returns>成功返回True,失败返回False</returns> public bool AffirmBill(string billNo, DataTable list, out string error) { error = null; DepotManagementDataContext ctx = CommentParameter.DepotDataContext; ctx.Connection.Open(); ctx.Transaction = ctx.Connection.BeginTransaction(); try { var varData = from a in ctx.WS_ConsumptionBill where a.BillNo == billNo select a; WS_ConsumptionBill tempBill = new WS_ConsumptionBill(); if (varData.Count() == 1) { tempBill = varData.Single(); if (tempBill.BillStatus != ConsumptionBillStatus.等待确认.ToString()) { throw new Exception("单据状态错误,请重新确认"); } tempBill.BillStatus = ConsumptionBillStatus.单据已完成.ToString(); tempBill.Affirm = BasicInfo.LoginName; tempBill.AffirmDate = ServerTime.Time; } else { throw new Exception("数据不唯一,请重新确认"); } ListControl(ctx, tempBill, list); ctx.SubmitChanges(); foreach (DataRow dr in list.Rows) { WS_Subsidiary tempSubsidiary = new WS_Subsidiary(); tempSubsidiary.BatchNo = dr["批次号"].ToString(); tempSubsidiary.BillNo = tempBill.BillNo; tempSubsidiary.GoodsID = Convert.ToInt32(dr["物品ID"]); tempSubsidiary.OperationCount = Convert.ToDecimal(dr["数量"]); tempSubsidiary.OperationType = (int)CE_SubsidiaryOperationType.车间耗用; tempSubsidiary.Remark = dr["备注"].ToString(); tempSubsidiary.WSCode = tempBill.WSCode; tempSubsidiary.Proposer = tempBill.Proposer; tempSubsidiary.ProposerDate = (DateTime)tempBill.ProposerDate; tempSubsidiary.Affirm = BasicInfo.LoginName; tempSubsidiary.AffirmDate = ServerTime.Time; IWorkShopStock serverStock = ServerModuleFactory.GetServerModule <IWorkShopStock>(); WS_WorkShopStock tempWSStock = serverStock.GetStockSingleInfo(tempSubsidiary.WSCode, tempSubsidiary.GoodsID, tempSubsidiary.BatchNo); tempSubsidiary.UnitPrice = tempWSStock == null ? 0 : tempWSStock.UnitPrice; tempSubsidiary.BillTime = ServerTime.Time; View_HR_Personnel tempHR = UniversalFunction.GetPersonnelInfo(tempSubsidiary.Proposer); if (tempHR == null) { throw new Exception("申请人员不存在"); } tempSubsidiary.Applicant = tempHR.部门名称; serverStock.OperationSubsidiary(ctx, tempSubsidiary); } ctx.SubmitChanges(); ctx.Transaction.Commit(); return(true); } catch (Exception ex) { ctx.Transaction.Rollback(); error = ex.Message; return(false); } }
/// <summary> /// 生成采购退货单 /// </summary> /// <param name="context">数据上下文</param> /// <param name="billNo">单据号</param> void InsertRejectBill(DepotManagementDataContext context, string billNo) { string error = null; IMaterialRejectBill serverRejectBill = ServerModule.ServerModuleFactory.GetServerModule <IMaterialRejectBill>(); IMaterialListRejectBill serverRejectListBill = ServerModule.ServerModuleFactory.GetServerModule <IMaterialListRejectBill>(); var varData = from a in context.S_ScrapBill where a.Bill_ID == billNo select a; if (varData.Count() == 0) { return; } S_ScrapBill scarpBill = varData.Single(); List <string> lstProvider = (from a in context.S_ScrapGoods where a.Bill_ID == billNo && a.ResponsibilityProvider == a.Provider select a.Provider).Distinct().ToList(); foreach (string provider in lstProvider) { var dataProviderWork = from a in context.ProviderPrincipal where a.Provider == provider && a.IsMainDuty == true select a; View_HR_Personnel personnelInfo = UniversalFunction.GetPersonnelInfo(context, dataProviderWork.First().PrincipalWorkId); S_MaterialRejectBill bill = new S_MaterialRejectBill(); bill.Bill_ID = m_assignBill.AssignNewNo(context, serverRejectBill, CE_BillTypeEnum.采购退货单.ToString()); bill.Bill_Time = ServerTime.Time; bill.BillStatus = MaterialRejectBillBillStatus.已完成.ToString(); bill.Department = personnelInfo.部门编码; bill.FillInPersonnel = personnelInfo.姓名; bill.FillInPersonnelCode = personnelInfo.工号; bill.DepotManager = BasicInfo.LoginName; bill.Provider = provider; bill.Reason = "由【报废单】:" + billNo + " 生成的报废退货"; bill.Remark = "系统自动生成"; bill.BillType = "总仓库退货单"; bill.StorageID = "01"; bill.OutDepotDate = ServerTime.Time; context.S_MaterialRejectBill.InsertOnSubmit(bill); context.SubmitChanges(); var varData2 = from a in context.S_ScrapGoods where a.Provider == provider && a.Bill_ID == billNo && a.ResponsibilityProvider == a.Provider select a; foreach (S_ScrapGoods goodsInfo in varData2) { string orderForm = GetOrderForm(context, goodsInfo.GoodsID, goodsInfo.BatchNo, provider); if (orderForm == null) { throw new Exception(UniversalFunction.GetGoodsMessage(context, goodsInfo.GoodsID) + " 批次号:【" + goodsInfo.BatchNo + "】 供应商:【" + provider + "】 找不到对应的【订单号】"); } QueryCondition_Store queryInfo = new QueryCondition_Store(); queryInfo.BatchNo = goodsInfo.BatchNo; queryInfo.GoodsID = goodsInfo.GoodsID; queryInfo.StorageID = "01"; S_Stock stockInfo = UniversalFunction.GetStockInfo(context, queryInfo); //插入业务明细信息 S_MaterialListRejectBill goods = new S_MaterialListRejectBill(); goods.Bill_ID = bill.Bill_ID; goods.GoodsID = goodsInfo.GoodsID; goods.Provider = provider; goods.ProviderBatchNo = stockInfo == null ? "" : stockInfo.ProviderBatchNo; goods.BatchNo = goodsInfo.BatchNo; goods.Amount = (decimal)goodsInfo.Quantity; goods.Remark = ""; goods.AssociateID = orderForm; if (!serverRejectListBill.SetPriceInfo(goods.AssociateID, goods, bill.StorageID, out error)) { throw new Exception(error); } context.S_MaterialListRejectBill.InsertOnSubmit(goods); context.SubmitChanges(); } serverRejectBill.OpertaionDetailAndStock(context, bill); context.SubmitChanges(); } }
/// <summary> /// 界面初始化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void 营销退货明细单_Load(object sender, EventArgs e) { DataTable dt = m_findSellIn.GetBill(m_strDJH, m_intDJID); m_drZdRK = dt.NewRow(); if (m_intDJID != 0) { m_strDJZTFlag = dt.Rows[0]["DJZT_Flag"].ToString(); View_HR_Personnel lnqPersonnel = m_findPersonnel.GetPersonnelInfo(dt.Rows[0]["LRRY"].ToString()); lbUserName.Text = lnqPersonnel.姓名.ToString(); lbUserName.Tag = lnqPersonnel.工号.ToString(); lbKS.Text = lnqPersonnel.部门名称.ToString(); lbKS.Tag = lnqPersonnel.部门编码.ToString(); m_dtMxRK = m_findSellIn.GetList(m_intDJID); tbsDept.Tag = dt.Rows[0]["ObjectDept"].ToString(); View_Department linVdepartment = m_findDepartmentServer.GetDepartments(dt.Rows[0]["ObjectDept"].ToString()); tbsDept.Text = linVdepartment.部门名称; txtSellID.Text = dt.Rows[0]["DJH"].ToString(); txtPrice.Text = dt.Rows[0]["Price"].ToString(); cmbTHFS.Text = dt.Rows[0]["YWFS"].ToString(); txtRemarkAll.Text = dt.Rows[0]["Remark"].ToString(); cmbStorage.Text = UniversalFunction.GetStorageName(dt.Rows[0]["StorageID"].ToString()); } else { m_strDJZTFlag = "已保存"; lbUserName.Text = BasicInfo.LoginName; lbUserName.Tag = BasicInfo.LoginID; lbKS.Text = BasicInfo.DeptName; lbKS.Tag = BasicInfo.DeptCode; txtSellID.Text = m_billNoControl.GetNewBillNo(); CreateDateTableStyle(); } if (m_strDJZTFlag != "已保存" && m_strDJZTFlag != "") { cmbTHFS.Enabled = false; tbsDept.Enabled = false; cmbStorage.Enabled = false; } dgv_Main.DataSource = m_dtMxRK; m_strDJH = txtSellID.Text.Trim(); if (cmbStorage.Text == "售后库房") { label11.Visible = true; cmbRepairStatus.Visible = true; dgv_Main.Columns["RepairStatus"].Visible = true; } else { label11.Visible = false; cmbRepairStatus.Visible = false; dgv_Main.Columns["RepairStatus"].Visible = false; } }
/// <summary> /// 登录 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnOk_Click(object sender, EventArgs e) { try { if (cmbSystem.Text == "") { MessageDialog.ShowPromptMessage("请选择【系统平台】"); return; } if (FindWindow(null, cmbSystem.Text + "信息化系统") != IntPtr.Zero) { MessageDialog.ShowPromptMessage("您已经运行了一个【" + cmbSystem.Text + "信息化】程序,无法运行多个"); return; } if (txtUserCode.Text == "" || txtPwd.Text == "") { MessageDialog.ShowPromptMessage("请填写完整用户信息!"); return; } GlobalParameter.Init(cmbSystem.Text); DBOperateERP.AccessDB.InitDBOperate(); GlobalObject.DatabaseServer.IsConnection(); string loginNotice = UniversalFunction.GetSwitchKey()[13]; string workID = UniversalFunction.GetWorkID(txtUserCode.Text); if (AuthenticationManager.IdentifyAuthority(workID, txtPwd.Text)) { LoggingFlag = true; //if ((loginNotice != null && loginNotice.Length > 0) // && loginNotice != GlobalParameter.LoginNotice) //{ // 登陆界面温馨提示 frm = new 登陆界面温馨提示(loginNotice); // frm.ShowDialog(); //} IAuthentication authentication = AuthenticationManager.Authentication; List <string> listRoles = new List <string>(); string[] roleCodes = new string[authentication.Roles.Count]; for (int i = 0; i < authentication.Roles.Count; i++) { listRoles.Add(authentication.Roles[i].角色名称); roleCodes[i] = authentication.Roles[i].角色编码; } View_HR_Personnel personnelInfo = UniversalFunction.GetPersonnelInfo(workID); if (personnelInfo == null || personnelInfo.工号 == null) { throw new Exception("【工号】:" + workID + " 不存在,请咨询人力资源"); } else if (!personnelInfo.是否在职) { throw new Exception("【工号】:" + workID + " 已【离职】,请咨询人力资源"); } BasicInfo.LoginID = personnelInfo.工号; BasicInfo.LoginName = personnelInfo.姓名; BasicInfo.DeptCode = personnelInfo.部门编码; BasicInfo.DeptName = personnelInfo.部门名称; BasicInfo.BaseSwitchInfo = UniversalFunction.GetSwitchKey(); GlobalParameter.UserCode = txtUserCode.Text; GlobalParameter.LoginNotice = loginNotice; GlobalParameter.Save(); BasicInfo.ListRoles = listRoles; BasicInfo.RoleCodes = roleCodes; if (BasicInfo.ListRoles.Contains("物流公司") && BasicInfo.ListRoles.Contains("物流公司_库管理员") && BasicInfo.ListRoles.Count() == 2 && cmbSystem.SelectedIndex == 0) { throw new Exception("物流公司,无法登陆【湖南容大】信息化系统"); } this.Close(); } } catch (Exception err) { MessageDialog.ShowErrorMessage(err.Message); return; } }
void SetInfo() { if (_Lnq_BillInfo == null) { lbBillStatus.Text = CE_CommonBillStatus.新建单据.ToString(); _Lnq_BillInfo = new Bus_Quality_8DReport(); txtBillNo.Text = this.FlowInfo_BillNo; _Lnq_BillInfo.BillNo = txtBillNo.Text; _Lnq_BillInfo.F_Id = Guid.NewGuid().ToString(); } else { lbBillStatus.Text = _Service_Flow.GetNowBillStatus(_Lnq_BillInfo.BillNo); txtBillNo.Text = _Lnq_BillInfo.BillNo; txtBatchNo.Text = _Lnq_BillInfo.BatchNo; txtBadness.Text = _Lnq_BillInfo.Badness; txtTheme.Text = _Lnq_BillInfo.Theme; txtInvolve.Text = _Lnq_BillInfo.Involve; txtHappenSite.Text = _Lnq_BillInfo.HappenSite; dtpHappenDate.Value = _Lnq_BillInfo.HappenDate == null ? ServerTime.Time : (DateTime)dtpHappenDate.Value; txtGoodsInfo.Text = _Lnq_BillInfo.GoodsInfo; //D1 txtD1_DescribePhenomenon.Text = _Lnq_BillInfo.D1_DescribePhenomenon; if (_Lnq_BillInfo.D1_DescribePhenomenon_Accessory != null) { llbD1_DescribePhenomenon_Accessory.Tag = _Lnq_BillInfo.D1_DescribePhenomenon_Accessory; llbD1_DescribePhenomenon_Accessory.Enabled = true; llbD1_DescribePhenomenon_Accessory_DownLoad.Enabled = true; } if (_Lnq_BillInfo.D1_LastHappenTime != null) { dtpD1_LastHappenTime.Value = (DateTime)_Lnq_BillInfo.D1_LastHappenTime; PanelRadioButtonSetChecked(plD1_LastHappenTime, "是"); } if (_Lnq_BillInfo.D1_InfluenceElseProduct_Explain != null) { txtD1_InfluenceElseProduct_Explain.Text = _Lnq_BillInfo.D1_InfluenceElseProduct_Explain; PanelRadioButtonSetChecked(plD1_InfluenceElseProduct_Explain, "是"); } if (_Lnq_BillInfo.D1_DutyDepartment != null) { foreach (Control cl in plD1_DutyDepartment.Controls) { if (cl is RadioButton) { RadioButton rb = cl as RadioButton; if (rb.Text == _Lnq_BillInfo.D1_DutyDepartment) { rb.Checked = true; break; } } } } //D2 if (_Lnq_BillInfo.D2_DutyPersonnel != null) { txtD2_DutyPersonnel.Text = UniversalFunction.GetPersonnelInfo(_Lnq_BillInfo.D2_DutyPersonnel).姓名; txtD2_DutyPersonnel.Tag = _Lnq_BillInfo.D2_DutyPersonnel; } foreach (Bus_Quality_8DReport_D2_Crew item in _Lnq_BillInfo.Bus_Quality_8DReport_D2_Crew.ToList()) { View_HR_Personnel personnelInfo = UniversalFunction.GetPersonnelInfo(item.PersonnelWorkId); dgvD2_Crew.Rows.Add(new object[] { personnelInfo.姓名, personnelInfo.部门名称, personnelInfo.工号 }); } //D3 if (_Lnq_BillInfo.D3_Reason_Incoming != null) { txtD3_Reason_Incoming.Text = _Lnq_BillInfo.D3_Reason_Incoming; PanelRadioButtonSetChecked(plD3_Reason_Incoming, "是"); } if (_Lnq_BillInfo.D3_Reason_Producted != null) { txtD3_Reason_Producted.Text = _Lnq_BillInfo.D3_Reason_Producted; PanelRadioButtonSetChecked(plD3_Reason_Producted, "是"); } if (_Lnq_BillInfo.D3_Reason_Production != null) { txtD3_Reason_Production.Text = _Lnq_BillInfo.D3_Reason_Production; PanelRadioButtonSetChecked(plD3_Reason_Production, "是"); } if (_Lnq_BillInfo.D3_Reason_Send != null) { txtD3_Reason_Send.Text = _Lnq_BillInfo.D3_Reason_Send; PanelRadioButtonSetChecked(plD3_Reason_Send, "是"); } //D4 if (_Lnq_BillInfo.D4_Else_Measure != null) { txtD4_Else_Measure.Text = _Lnq_BillInfo.D4_Else_Measure; txtD4_Else_NG.Text = _Lnq_BillInfo.D4_Else_NG; txtD4_Else_OK.Text = _Lnq_BillInfo.D4_Else_OK; PanelRadioButtonSetChecked(plD4_Else, "是"); } if (_Lnq_BillInfo.D4_FinishClient_Measure != null) { txtD4_FinishClient_Measure.Text = _Lnq_BillInfo.D4_FinishClient_Measure; txtD4_FinishClient_NG.Text = _Lnq_BillInfo.D4_FinishClient_NG; txtD4_FinishClient_OK.Text = _Lnq_BillInfo.D4_FinishClient_OK; PanelRadioButtonSetChecked(plD4_FinishClient, "是"); } if (_Lnq_BillInfo.D4_FinishCom_Measure != null) { txtD4_FinishCom_Measure.Text = _Lnq_BillInfo.D4_FinishCom_Measure; txtD4_FinishCom_NG.Text = _Lnq_BillInfo.D4_FinishCom_NG; txtD4_FinishCom_OK.Text = _Lnq_BillInfo.D4_FinishCom_OK; PanelRadioButtonSetChecked(plD4_FinishCom, "是"); } if (_Lnq_BillInfo.D4_Loading_Measure != null) { txtD4_Loading_Measure.Text = _Lnq_BillInfo.D4_Loading_Measure; txtD4_Loading_NG.Text = _Lnq_BillInfo.D4_Loading_NG; txtD4_Loading_OK.Text = _Lnq_BillInfo.D4_Loading_OK; PanelRadioButtonSetChecked(plD4_Loading, "是"); } if (_Lnq_BillInfo.D4_Semi_Measure != null) { txtD4_Semi_Measure.Text = _Lnq_BillInfo.D4_Semi_Measure; txtD4_Semi_NG.Text = _Lnq_BillInfo.D4_Semi_NG; txtD4_Semi_OK.Text = _Lnq_BillInfo.D4_Semi_OK; PanelRadioButtonSetChecked(plD4_Semi, "是"); } txtD4_HowIdentify.Text = _Lnq_BillInfo.D4_HowIdentify; //D5 txtD5_ReasonAnalysis.Text = _Lnq_BillInfo.D5_ReasonAnalysis; if (_Lnq_BillInfo.D5_ReasonAnalysis_Accessory != null) { llbD5_ReasonAnalysis_Accessory.Tag = _Lnq_BillInfo.D5_ReasonAnalysis_Accessory; llbD5_ReasonAnalysis_Accessory.Enabled = true; llbD5_ReasonAnalysis_Accessory_DownLoad.Enabled = true; } foreach (Bus_Quality_8DReport_D5_Reason item in _Lnq_BillInfo.Bus_Quality_8DReport_D5_Reason.Where(k => k.ReasonType == dgvD5_Reason_Out.Parent.Text).ToList()) { dgvD5_Reason_Out.Rows.Add(new object[] { item.Description }); } foreach (Bus_Quality_8DReport_D5_Reason item in _Lnq_BillInfo.Bus_Quality_8DReport_D5_Reason.Where(k => k.ReasonType == dgvD5_Reason_Pro.Parent.Text).ToList()) { dgvD5_Reason_Pro.Rows.Add(new object[] { item.Description }); } //D6 foreach (Bus_Quality_8DReport_D6_Countermeasure item in _Lnq_BillInfo.Bus_Quality_8DReport_D6_Countermeasure.Where(k => k.CountermeasureType == dgvD6_Countermeasure_Out.Parent.Text).ToList()) { dgvD6_Countermeasure_Out.Rows.Add(new object[] { item.Description, item.Duty, item.FinishDate }); } foreach (Bus_Quality_8DReport_D6_Countermeasure item in _Lnq_BillInfo.Bus_Quality_8DReport_D6_Countermeasure.Where(k => k.CountermeasureType == dgvD6_Countermeasure_Pro.Parent.Text).ToList()) { dgvD6_Countermeasure_Pro.Rows.Add(new object[] { item.Description, item.Duty, item.FinishDate }); } //D7 List <Bus_Quality_8DReport_D7_Prevent> lstPrevent = _Lnq_BillInfo.Bus_Quality_8DReport_D7_Prevent.ToList(); foreach (string item in _Arrary_PreventType) { List <Bus_Quality_8DReport_D7_Prevent> lstTemp = lstPrevent.Where(k => k.ItemsType == item).ToList(); if (lstTemp.Count() == 1) { dgvD7_Prevent.Rows.Add(new object[] { true, item, lstTemp.Single().Department, lstTemp.Single().OperationTime }); } else { dgvD7_Prevent.Rows.Add(new object[] { false, item, "", "" }); } } foreach (DataGridViewRow dgvr in dgvD7_Prevent.Rows) { if (Convert.ToBoolean(dgvr.Cells[0].Value)) { dgvr.Cells[2].ReadOnly = false; dgvr.Cells[3].ReadOnly = false; } else { dgvr.Cells[2].ReadOnly = true; dgvr.Cells[3].ReadOnly = true; dgvr.Cells[2].Value = null; dgvr.Cells[3].Value = null; } dgvr.Cells[1].ReadOnly = true; } //D8 if (_Lnq_BillInfo.D8_Unfulfillment_Explain != null) { txtD8_Unfulfillment_Explain.Text = _Lnq_BillInfo.D8_Unfulfillment_Explain; PanelRadioButtonSetChecked(plD8_Unfulfillment_Explain, "否"); } foreach (Bus_Quality_8DReport_D8_Verify item in _Lnq_BillInfo.Bus_Quality_8DReport_D8_Verify.ToList()) { dgvD8_Verify.Rows.Add(new object[] { item.WayMode, item.Result, item.Duty, item.OperationDate, item.Effect }); } } }
private void btnDataGridViewRowAdd_Click(object sender, EventArgs e) { try { Button bt = sender as Button; switch (bt.Name) { case "btnD2_Crew_Add": if (GeneralFunction.IsNullOrEmpty(txtD2_Crew.Text)) { throw new Exception("请选择【改善小组组员】"); } foreach (DataGridViewRow dgvr in dgvD2_Crew.Rows) { if (dgvr.Cells["D2PersonnelWorkId"].Value.ToString() == txtD2_Crew.Tag.ToString()) { return; } } View_HR_Personnel personnnelInfo = UniversalFunction.GetPersonnelInfo(txtD2_Crew.Tag.ToString()); dgvD2_Crew.Rows.Add(new object[] { personnnelInfo.姓名, personnnelInfo.部门名称, personnnelInfo.工号 }); txtD2_Crew.Text = ""; txtD2_Crew.Tag = null; break; case "btnD5_Reason_Pro_Add": if (GeneralFunction.IsNullOrEmpty(txtD5_Reason_Pro_Des.Text)) { throw new Exception("请填写【产生原因描述】"); } dgvD5_Reason_Pro.Rows.Add(new object[] { txtD5_Reason_Pro_Des.Text }); txtD5_Reason_Pro_Des.Text = ""; break; case "btnD5_Reason_Out_Add": if (GeneralFunction.IsNullOrEmpty(txtD5_Reason_Out_Des.Text)) { throw new Exception("请填写【流出原因描述】"); } dgvD5_Reason_Out.Rows.Add(new object[] { txtD5_Reason_Out_Des.Text }); txtD5_Reason_Out_Des.Text = ""; break; case "btnD6_Countermeasure_Pro_Add": if (GeneralFunction.IsNullOrEmpty(txtD6_Countermeasure_Pro_Des.Text)) { throw new Exception("请填写【产生原因描述】"); } if (GeneralFunction.IsNullOrEmpty(txtD6_Countermeasure_Pro_Duty.Text)) { throw new Exception("请填写【负责人/部门】"); } dgvD6_Countermeasure_Pro.Rows.Add(new object[] { txtD6_Countermeasure_Pro_Des.Text, txtD6_Countermeasure_Pro_Duty.Text, dtpD6_Countermeasure_Pro.Value }); txtD6_Countermeasure_Pro_Des.Text = ""; txtD6_Countermeasure_Pro_Duty.Text = ""; dtpD6_Countermeasure_Pro.Value = ServerTime.Time; break; case "btnD6_Countermeasure_Out_Add": if (GeneralFunction.IsNullOrEmpty(txtD6_Countermeasure_Out_Des.Text)) { throw new Exception("请填写【流出原因描述】"); } if (GeneralFunction.IsNullOrEmpty(txtD6_Countermeasure_Out_Duty.Text)) { throw new Exception("请填写【负责人/部门】"); } dgvD6_Countermeasure_Out.Rows.Add(new object[] { txtD6_Countermeasure_Out_Des.Text, txtD6_Countermeasure_Out_Duty.Text, dtpD6_Countermeasure_Out.Value }); txtD6_Countermeasure_Out_Des.Text = ""; txtD6_Countermeasure_Out_Duty.Text = ""; dtpD6_Countermeasure_Out.Value = ServerTime.Time; break; case "btnD8_Verify_Add": if (GeneralFunction.IsNullOrEmpty(txtD8_Verify_WayMode.Text)) { throw new Exception("请填写【验证方式】"); } if (GeneralFunction.IsNullOrEmpty(txtD8_Verify_Result.Text)) { throw new Exception("请填写【验证结果】"); } if (GeneralFunction.IsNullOrEmpty(txtD8_Verify_Duty.Text)) { throw new Exception("请填写【负责人/部门】"); } if (GeneralFunction.IsNullOrEmpty(cmbD8_Verify_Effect.Text)) { throw new Exception("请选择【效果】"); } dgvD8_Verify.Rows.Add(new object[] { txtD8_Verify_WayMode.Text, txtD8_Verify_Result.Text, txtD8_Verify_Duty.Text, dtpD8_Verify.Value, cmbD8_Verify_Effect.Text }); txtD8_Verify_WayMode.Text = ""; txtD8_Verify_Result.Text = ""; txtD8_Verify_Duty.Text = ""; cmbD8_Verify_Effect.SelectedIndex = -1; dtpD8_Verify.Value = ServerTime.Time; break; default: break; } } catch (Exception ex) { MessageDialog.ShowPromptMessage(ex.Message); } }
/// <summary> /// 界面初始化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void 营销入库明细单_Load(object sender, EventArgs e) { DataTable dt = m_findSellIn.GetBill(m_strDJH, m_intDJID); m_drZdRK = dt.NewRow(); if (m_intDJID != 0) { View_HR_Personnel lnqPersonnel = m_findPersonnel.GetPersonnelInfo(dt.Rows[0]["LRRY"].ToString()); m_strDJZTFlag = dt.Rows[0]["DJZT_Flag"].ToString(); lbUserName.Text = lnqPersonnel.姓名.ToString(); lbUserName.Tag = lnqPersonnel.工号.ToString(); lbKS.Text = lnqPersonnel.部门名称.ToString(); lbKS.Tag = lnqPersonnel.部门编码.ToString(); m_dtMxRK = m_findSellIn.GetList(m_intDJID); tbsDept.Tag = dt.Rows[0]["ObjectDept"].ToString(); txtSellID.Text = dt.Rows[0]["DJH"].ToString(); View_Department linVdepartment = m_findDepartmentServer.GetDepartments(dt.Rows[0]["ObjectDept"].ToString()); tbsDept.Text = linVdepartment.部门名称; txtPrice.Text = dt.Rows[0]["Price"].ToString(); txtRemarkAll.Text = dt.Rows[0]["Remark"].ToString(); cmbRKFS.Text = dt.Rows[0]["YWFS"].ToString(); cmbStorage.Text = UniversalFunction.GetStorageName(dt.Rows[0]["StorageID"].ToString()); m_lnqWSCode = m_serverWSBasic.GetWorkShopCodeInfo(tbsDept.Tag.ToString()); } else { m_strDJZTFlag = "已保存"; lbUserName.Text = BasicInfo.LoginName; lbUserName.Tag = BasicInfo.LoginID; lbKS.Text = BasicInfo.DeptName; lbKS.Tag = BasicInfo.DeptCode; WS_WorkShopCode tempWorkCodeInfo = m_serverWSBasic.GetPersonnelWorkShop(BasicInfo.LoginID); if (tempWorkCodeInfo != null) { tbsDept.Text = tempWorkCodeInfo.WSName; tbsDept.Tag = tempWorkCodeInfo.DeptCode; } txtSellID.Text = m_billNoControl.GetNewBillNo(); CreateDateTableStyle(); } if (!Convert.ToBoolean(BasicInfo.BaseSwitchInfo[(int)GlobalObject.CE_SwitchName.开启车间管理模块])) { txtBatchNo.Enabled = false; } if (m_strDJZTFlag != "已保存" && m_strDJZTFlag != "") { cmbRKFS.Enabled = false; tbsDept.Enabled = false; cmbStorage.Enabled = false; if (UniversalFunction.CheckStorageAndPersonnel(dt.Rows[0]["StorageID"].ToString()) == false) { btnAffirm.Visible = false; } } OperationbtnCheckIsVisible(m_dtMxRK); //DataRow drDept = m_serverDepartment.GetPersonnelAffiliatedTopFunction(lbUserName.Text).Rows[0]; //tbsDept.Enabled = false; //tbsDept.Text = drDept["DepartmentName"].ToString(); //tbsDept.Tag = drDept["DepartmentCode"].ToString(); dgv_Main.DataSource = m_dtMxRK; m_strDJH = txtSellID.Text.Trim(); }
void SetInfo() { IFlowServer serverFlow = FlowControlService.ServerModuleFactory.GetServerModule <IFlowServer>(); dataGridView1.DataSource = m_mainService.GetReferenceInfo(dataGridView1.Tag.ToString()); dataGridView2.DataSource = m_mainService.GetReferenceInfo(dataGridView2.Tag.ToString()); dataGridView3.DataSource = m_mainService.GetReferenceInfo(dataGridView3.Tag.ToString()); if (m_lnqBillInfo != null) { lbBillStatus.Text = serverFlow.GetNowBillStatus(m_lnqBillInfo.BillNo); txtBillNo.Text = m_lnqBillInfo.BillNo; Flow_FlowInfo flowInfo = serverFlow.GetNowFlowInfo(serverFlow.GetBusinessTypeID(CE_BillTypeEnum.创意提案, null), m_lnqBillInfo.BillNo); Flow_FlowData flowData = serverFlow.GetBusinessOperationInfo(txtBillNo.Text, CE_CommonBillStatus.新建单据.ToString())[0]; View_HR_Personnel sqrInfo = UniversalFunction.GetPersonnelInfo(m_lnqBillInfo.Propose); txtDept.Text = sqrInfo.部门名称; txtPropose.Text = sqrInfo.姓名; txtPropose.Tag = sqrInfo.工号; txtImproveConditions_After.Text = m_lnqBillInfo.ImproveConditions_After; txtImproveConditions_Before.Text = m_lnqBillInfo.ImproveConditions_Before; txtTask.Text = m_lnqBillInfo.Task; dtpImproveEndDate.Value = m_lnqBillInfo.ImproveEndDate; dtpImproveStartDate.Value = m_lnqBillInfo.ImproveStartDate; cmbExtensionCoverage.Text = m_lnqBillInfo.ExtensionCoverage; txtValueEffect.Text = m_lnqBillInfo.ValueEffect.ToString(); numFGLD_Abstract.Value = m_lnqBillInfo.FGLD_Abstract == null ? 0 : (int)m_lnqBillInfo.FGLD_Abstract; numFGLD_Apply.Value = m_lnqBillInfo.FGLD_Apply == null ? 0 : (int)m_lnqBillInfo.FGLD_Apply; numFGLD_Economy.Value = m_lnqBillInfo.FGLD_Economy == null ? 0 : (int)m_lnqBillInfo.FGLD_Economy; numFGLD_Ideas.Value = m_lnqBillInfo.FGLD_Ideas == null ? 0 : (int)m_lnqBillInfo.FGLD_Ideas; numFGLD_Strive.Value = m_lnqBillInfo.FGLD_Strive == null ? 0 : (int)m_lnqBillInfo.FGLD_Strive; numFZR_Abstract.Value = m_lnqBillInfo.FZR_Abstract == null ? 0 : (int)m_lnqBillInfo.FZR_Abstract; numFZR_Apply.Value = m_lnqBillInfo.FZR_Apply == null ? 0 : (int)m_lnqBillInfo.FZR_Apply; numFZR_Economy.Value = m_lnqBillInfo.FZR_Economy == null ? 0 : (int)m_lnqBillInfo.FZR_Economy; numFZR_Ideas.Value = m_lnqBillInfo.FZR_Ideas == null ? 0 : (int)m_lnqBillInfo.FZR_Ideas; numFZR_Strive.Value = m_lnqBillInfo.FZR_Strive == null ? 0 : (int)m_lnqBillInfo.FZR_Strive; lbImproveConditions_After_FileNo_Look.Tag = m_lnqBillInfo.ImproveConditions_After_FileNo; lbImproveConditions_Before_FileNo_Look.Tag = m_lnqBillInfo.ImproveConditions_Before_FileNo; List <string> lstCheck = m_lnqBillInfo.ProposalType.Split(',').ToList(); foreach (Control cl in customGroupBox1.Controls) { if (cl is CheckBox) { CheckBox cb = cl as CheckBox; if (lstCheck.Contains(cb.Text)) { cb.Checked = true; } } } foreach (Control cl in tabPage1.Controls) { if (cl is CustomGroupBox) { CustomGroupBox gb = cl as CustomGroupBox; if (gb.Tag != null && gb.Tag.ToString().Trim().Length > 0) { if (flowInfo.FlowID == Convert.ToInt32(gb.Tag)) { gb.Enabled = true; } else { gb.Enabled = false; } } } } if (lbBillStatus.Text != CE_CommonBillStatus.新建单据.ToString()) { txtImproveConditions_After.ReadOnly = true; txtImproveConditions_Before.ReadOnly = true; } } else { lbBillStatus.Text = CE_CommonBillStatus.新建单据.ToString(); m_lnqBillInfo = new Business_CWQC_CreativePersentation(); txtBillNo.Text = this.FlowInfo_BillNo; m_lnqBillInfo.BillNo = txtBillNo.Text; View_HR_Personnel sqrInfo = UniversalFunction.GetPersonnelInfo(BasicInfo.LoginID); txtDept.Text = sqrInfo.部门名称; txtPropose.Text = sqrInfo.姓名; txtPropose.Tag = sqrInfo.工号; if (!isDirectAdd) { customGroupBox6.Enabled = false; customGroupBox7.Enabled = false; } } if (lbBillStatus.Text == CE_CommonBillStatus.新建单据.ToString()) { lbImproveConditions_After_FileNo_Up.Visible = true; lbImproveConditions_Before_FileNo_Up.Visible = true; } else { lbImproveConditions_After_FileNo_Up.Visible = false; lbImproveConditions_Before_FileNo_Up.Visible = false; } if (lbImproveConditions_After_FileNo_Look.Tag != null && lbImproveConditions_After_FileNo_Look.Tag.ToString().Trim().Length > 0) { lbImproveConditions_After_FileNo_Look.Visible = true; } else { lbImproveConditions_After_FileNo_Look.Visible = false; } if (lbImproveConditions_Before_FileNo_Look.Tag != null && lbImproveConditions_Before_FileNo_Look.Tag.ToString().Trim().Length > 0) { lbImproveConditions_Before_FileNo_Look.Visible = true; } else { lbImproveConditions_Before_FileNo_Look.Visible = false; } FZRSetInfo(); FGLDSetInfo(); SetInfo_EffectValue(); }
/// <summary> /// 根据角色类型与科室编码获得角色名称列表 /// </summary> /// <param name="ctx">数据上下文</param> /// <param name="roleStyle">角色类型</param> /// <param name="deptInfo">角色类型为仓管则为库房代码,角色类型为上级领导则为所需操作人员的人员工号或姓名,否则为需操作的部门编码</param> /// <returns>返回列表</returns> public List <string> GetSuperior(DepotManagementDataContext ctx, CE_RoleStyleType roleStyle, string info) { List <string> result = new List <string>(); if (info != null && info != "") { View_HR_Personnel personnelInfo = UniversalFunction.GetPersonnelInfo(ctx, info); switch (roleStyle) { case CE_RoleStyleType.仓管: List <CE_RoleEnum> tempListRole = UniversalFunction.GetStoreroomKeeperRoleEnumList(info); foreach (CE_RoleEnum item in tempListRole) { result.Add(item.ToString()); } break; case CE_RoleStyleType.分管领导: result = GetDeptLeaderRoleName(personnelInfo == null ? info : personnelInfo.部门编码).ToList(); break; case CE_RoleStyleType.负责人: result = GetDeptPrincipalRoleName(personnelInfo == null ? info : personnelInfo.部门编码).ToList(); break; case CE_RoleStyleType.主管: result = GetDeptDirectorRoleName(personnelInfo == null ? info : personnelInfo.部门编码).ToList(); break; case CE_RoleStyleType.所有上级领导: List <string> lstFGLD1 = GetDeptLeaderRoleName(personnelInfo.部门编码).ToList(); List <string> lstFZR1 = GetDeptPrincipalRoleName(personnelInfo.部门编码).ToList(); List <string> lstZG1 = GetDeptDirectorRoleName(personnelInfo.部门编码).ToList(); result.AddRange(lstFGLD1); result.AddRange(lstFZR1); result.AddRange(lstZG1); break; case CE_RoleStyleType.级领导: List <string> lstFGLD = GetDeptLeaderRoleName(personnelInfo.部门编码).ToList(); List <string> lstFZR = GetDeptPrincipalRoleName(personnelInfo.部门编码).ToList(); List <string> lstZG = GetDeptDirectorRoleName(personnelInfo.部门编码).ToList(); IRoleManagement serviceRole = PlatformFactory.GetObject <IRoleManagement>(); List <View_Auth_Role> lstRole = serviceRole.GetRoles(personnelInfo.工号).ToList(); List <CE_RoleStyleType> lstType = new List <CE_RoleStyleType>(); foreach (View_Auth_Role role in lstRole) { if (lstFGLD.Contains(role.角色名称)) { lstType.Add(CE_RoleStyleType.分管领导); } else if (lstFZR.Contains(role.角色名称)) { lstType.Add(CE_RoleStyleType.负责人); } else if (lstZG.Contains(role.角色名称)) { lstType.Add(CE_RoleStyleType.主管); } } if (lstType == null || lstType.Count == 0) { return(lstZG); } else if (lstType.Contains(CE_RoleStyleType.分管领导)) { result.Add(CE_RoleEnum.总经理.ToString()); result.Add(CE_RoleEnum.总经理.ToString()); return(result); } else if (lstType.Contains(CE_RoleStyleType.负责人)) { return(lstFGLD); } else if (lstType.Contains(CE_RoleStyleType.主管)) { return(lstFZR); } break; default: break; } } return(result); }
private void btnImport_Click(object sender, EventArgs e) { DataTable dtTemp = ExcelHelperP.RenderFromExcel(openFileDialog1); if (dtTemp == null) { return; } m_receivedUserType = GlobalObject.GeneralFunction.StringConvertToEnum <BillFlowMessage_ReceivedUserType>(tabControl1.SelectedTab.Name); switch (m_receivedUserType) { case BillFlowMessage_ReceivedUserType.用户: if (!dtTemp.Columns.Contains("员工姓名") && !dtTemp.Columns.Contains("员工编号")) { MessageDialog.ShowPromptMessage("无【员工编号】或【员工姓名】列"); return; } DataTable tempTable = ((DataTable)dataGridView2.DataSource).Clone(); foreach (DataRow dr in dtTemp.Rows) { DataRow newRow = tempTable.NewRow(); View_HR_Personnel personnel = new View_HR_Personnel(); object obj = ""; if (dtTemp.Columns.Contains("员工编号")) { obj = dr["员工编号"]; } else { obj = dr["员工姓名"]; } if (obj == null) { MessageDialog.ShowPromptMessage("有一行记录为空,请重新检查"); return; } personnel = UniversalFunction.GetPersonnelInfo(obj.ToString()); if (personnel == null) { MessageDialog.ShowPromptMessage("【员工编号】/【员工姓名】: " + obj.ToString() + " 数据错误,请重新检查"); return; } newRow["员工编号"] = personnel.工号; newRow["员工姓名"] = personnel.姓名; tempTable.Rows.Add(newRow); } dataGridView1.DataSource = tempTable; break; case BillFlowMessage_ReceivedUserType.角色: break; default: break; } }
void CreateMaterialRequisition(DepotManagementDataContext ctx, Business_WarehouseOutPut_WholeMachineRequisition billInfo, List <Business_WarehouseOutPut_WholeMachineRequisitionDetail> listDetail, List <Business_WarehouseOutPut_WholeMachineRequisition_StorageID> listStorage, out List <string> listBillNo) { listBillNo = null; ServerModule.IMaterialRequisitionGoodsServer serviceGoods = ServerModule.ServerModuleFactory.GetServerModule <ServerModule.IMaterialRequisitionGoodsServer>(); ServerModule.IMaterialRequisitionServer serviceBill = ServerModule.ServerModuleFactory.GetServerModule <ServerModule.IMaterialRequisitionServer>(); ServerModule.IStoreServer serviceStore = ServerModule.ServerModuleFactory.GetServerModule <ServerModule.IStoreServer>(); IFlowServer serviceFlow = FlowControlService.ServerModuleFactory.GetServerModule <IFlowServer>(); ServerModule.IMaterialRequisitionPurposeServer servicePurpose = ServerModule.ServerModuleFactory.GetServerModule <ServerModule.IMaterialRequisitionPurposeServer>(); BillNumberControl billControl = new BillNumberControl(CE_BillTypeEnum.领料单, serviceBill); List <CommonProcessInfo> listProcessInfo = serviceFlow.GetFlowData(billInfo.BillNo); try { List <GoodsInfo> listGoodsInfo = new List <GoodsInfo>(); foreach (Business_WarehouseOutPut_WholeMachineRequisitionDetail detail in listDetail) { decimal requstCount = detail.GoodsCount; foreach (Business_WarehouseOutPut_WholeMachineRequisition_StorageID storage in listStorage) { if (requstCount == 0) { break; } List <View_S_Stock> lstStock = serviceStore.GetGoodsStoreOnlyForAssembly(detail.GoodsID, storage.StorageID).ToList(); foreach (View_S_Stock stock in lstStock) { if (requstCount == 0) { break; } if (stock.库存数量 <= requstCount) { GoodsInfo goodsInfo = new GoodsInfo(); goodsInfo.GoodsID = detail.GoodsID; goodsInfo.BatchNo = stock.批次号; goodsInfo.Provider = stock.供货单位; goodsInfo.GoodsCount = stock.库存数量; goodsInfo.ListInfo = new List <string>(); goodsInfo.ListInfo.Add(listGoodsInfo.Count.ToString()); goodsInfo.ListInfo.Add(storage.StorageID); goodsInfo.ListInfo.Add(stock.库存数量.ToString()); listGoodsInfo.Add(goodsInfo); requstCount = requstCount - stock.库存数量; } else { GoodsInfo goodsInfo = new GoodsInfo(); goodsInfo.GoodsID = detail.GoodsID; goodsInfo.BatchNo = stock.批次号; goodsInfo.Provider = stock.供货单位; goodsInfo.GoodsCount = requstCount; goodsInfo.ListInfo = new List <string>(); goodsInfo.ListInfo.Add(listGoodsInfo.Count.ToString()); goodsInfo.ListInfo.Add(storage.StorageID); goodsInfo.ListInfo.Add(detail.GoodsCount.ToString()); listGoodsInfo.Add(goodsInfo); requstCount = 0; } } } } if (listGoodsInfo != null && listGoodsInfo.Count > 0) { listBillNo = new List <string>(); CommonProcessInfo firstProcess = new CommonProcessInfo(); CommonProcessInfo SecondProcess = new CommonProcessInfo(); CommonProcessInfo ThridProcess = new CommonProcessInfo(); var varTemp = from a in listProcessInfo where a.操作节点 == "新建" orderby a.时间 descending select a; if (varTemp.Count() != 0) { firstProcess = varTemp.First(); } else { throw new Exception("此单据无【新建】流程"); } varTemp = from a in listProcessInfo where a.操作节点 == "审核" orderby a.时间 descending select a; if (varTemp.Count() != 0) { SecondProcess = varTemp.First(); } else { throw new Exception("此单据无【审核】流程"); } varTemp = from a in listProcessInfo where a.操作节点 == "确认" orderby a.时间 descending select a; if (varTemp.Count() != 0) { ThridProcess = varTemp.First(); } foreach (Business_WarehouseOutPut_WholeMachineRequisition_StorageID storage in listStorage) { List <GoodsInfo> listGoodsInfoTemp = (from a in listGoodsInfo where a.ListInfo[1].ToString() == storage.StorageID orderby Convert.ToInt32(a.ListInfo[0]) select a).ToList(); if (listGoodsInfoTemp.Count > 0) { string error = ""; S_MaterialRequisition bill = new S_MaterialRequisition(); bill.AssociatedBillNo = billInfo.BillNo; bill.AssociatedBillType = CE_BillTypeEnum.整台份请领单.ToString(); bill.Bill_ID = billControl.GetNewBillNo(ctx); bill.Bill_Time = ServerTime.Time; bill.BillStatus = "等待出库"; View_HR_Personnel personnelInfo = UniversalFunction.GetPersonnelInfo(firstProcess.工号); bill.Department = personnelInfo.部门编码; bill.DepartmentDirector = SecondProcess.人员; bill.DepotManager = ThridProcess == new CommonProcessInfo() ? BasicInfo.LoginName : ThridProcess.人员; bill.FetchCount = (int)billInfo.MachineCount; bill.FetchType = FetchGoodsType.整台领料.ToString(); bill.FillInPersonnel = firstProcess.人员; bill.FillInPersonnelCode = personnelInfo.工号; bill.ProductType = billInfo.ProductType; bill.PurposeCode = servicePurpose.GetBillPurpose(ctx, billInfo.BillTypeDetail).Code; bill.Remark = billInfo.Remark; bill.StorageID = storage.StorageID; if (!serviceBill.AutoCreateBill(ctx, bill, out error)) { throw new Exception(error); } listBillNo.Add(bill.Bill_ID); for (int i = 0; i < listGoodsInfoTemp.Count; i++) { S_MaterialRequisitionGoods goodsInfo = new S_MaterialRequisitionGoods(); goodsInfo.BasicCount = Convert.ToDecimal(listGoodsInfoTemp[i].ListInfo[2]); goodsInfo.BatchNo = listGoodsInfoTemp[i].BatchNo; goodsInfo.Bill_ID = bill.Bill_ID; goodsInfo.GoodsID = listGoodsInfoTemp[i].GoodsID; goodsInfo.ProviderCode = listGoodsInfoTemp[i].Provider; goodsInfo.RealCount = listGoodsInfoTemp[i].GoodsCount; goodsInfo.Remark = GetWorkBench_WashFlag(billInfo.ProductType, goodsInfo.GoodsID); goodsInfo.RequestCount = listGoodsInfoTemp[i].GoodsCount; IProductOrder serviceProductOrder = ServerModuleFactory.GetServerModule <IProductOrder>(); goodsInfo.ShowPosition = 0; //serviceProductOrder.GetPosition(ctx, billInfo.ProductType, goodsInfo.GoodsID); if (!serviceGoods.AutoCreateGoods(ctx, goodsInfo, out error)) { throw new Exception(error); } } } ctx.SubmitChanges(); } } } catch (Exception ex) { throw new Exception(ex.Message); } }