| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231 |
- using System;
- using System.Collections.Generic;
- using com.hnshituo.pur.vo;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Tool;
- using Infragistics.Win.UltraWinGrid;
- using Pur.Entity;
- using Pur.Entity.configureEntity;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using Pur.ck;
- using CoreFS.CA06;
- using Pur.Pop_upWindow;
- using System.Collections;
- using Core.Mes.Client.Comm.Server;
- using Infragistics.Win.UltraWinEditors;
- using Pur.require_plan;
- using Pur.configure;
- namespace Pur.pur_plan
- {
- public partial class frmBID_FUNCTION : FrmPmsBase
- {
- string fileName = "";
- public string strSelName = "";
- public string strSelId = "";
- public frmBID_FUNCTION()
- {
- InitializeComponent();
- }
- /// <summary>
- /// 维护界面toolbar
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "doQuery":
- QureyBasePriceM("");
- break;
- case "doAdd":
- AddBasePriceM();
- break;
- case "doEffect":
- doEffect();//提报
- break;
- case "doRevokeEffect":
- doRevokeEffect();//撤销提报
- break;
-
- case "doSure":
- doSure1();//主管部长审核
- break;
- case "doSure1":
- doSure();//业务科长审核
- break;
- case "Save"://修改分配方案
- doUpdateBidFunctionM();
- break;
- case "SaveEvaRemark"://修改评标人员意见
- SaveEvaRemark();
- break;
- case "doDelete":
- DeleteBasePriceM();
- break;
- case "doExcel":
- //doExcel();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 弹窗按钮控件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void barsManagerButon_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key.ToString())
- {
- case "SelectSupp":
- {
- SelectFunction();
- }
- break;
- case "ESC":
- {
- this.Close();
- }
- break;
- }
- }
- private void SelectFunction()
- {
- strSelName = ultraGrid1.ActiveRow.Cells["NAME"].Value.ToString();
- strSelId = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
- }
- private void frmBID_FUNCTION_Load(object sender, EventArgs e)
- {
- splitContainer1.SplitterDistance = splitContainer1.Height / 2;
- //评标人员角色
- DataTable dt1 = ServerHelper.GetData("com.hnshituo.pur.configure.service.impl.CoreBaseInfoNew.doQuery", new Object[] { "1224" }, this.ob);
- dt1.DefaultView.RowFilter = "Validflag='1'";
- dt1 = dt1.DefaultView.ToTable();
- cmb_EVA_ROLE_NAME.DataSource = dt1;
- cmb_EVA_ROLE_NAME.DisplayMember = "BASENAME";
- cmb_EVA_ROLE_NAME.ValueMember = "BASECODE";
-
- }
- /// <summary>
- /// 查询分配方案
- /// </summary>
- private void QureyBasePriceM(String strId)
- {
- try
- {
- this.Cursor = Cursors.WaitCursor;
- clearTab();
- PurBidFunctionMEntity pm = new PurBidFunctionMEntity();
- //权限控制
- pm.ValidDataPurviewIds = this.ValidDataPurviewIds;
- //判断当前拥有此页面功能的角色是否启用数据权限,//0未启用
- //string QstrDataFlag = this.execute<string>("com.hnshituo.pur.utils.service.UtilsService", "getRoleDataFlag", new object[] { UserInfo.GetUserID(), "Pur.pur_plan.frmTaskMana_MC" });
- pm.Name = Qname.Text.Trim();
- pm.Validflag = "1";
- if (txt_status.SelectedIndex != -1)
- {
- pm.Flag = txt_status.Value.ToString().Trim();
- }
- DataTable re = this.execute<DataTable>("com.hnshituo.pur.purplan.service.BidFunctionMService", "doQureyBidFunctionM", new object[] { pm });
- GridHelper.CopyDataToDatatable(re, dataTable1, true);
- comm.RefreshAndAutoSizeExceptColumns(ultraGrid1);
- if (!String.IsNullOrEmpty(strId))
- {
- PublicTools.publicPms.doActiveSelRow(ultraGrid1, "id", strId);
- }
- }
- finally
- {
- this.Cursor = Cursors.Default;
- }
- }
- /// <summary>
- /// 查询评审人员
- /// </summary>
- /// <param name="strId"></param>
- private void doQueryEva()
- {
- dataTable4.Clear();
- PurBidFunctionEvasEntity pc = new PurBidFunctionEvasEntity();
- string strId = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
- pc.VersionNo = strId;
- pc.Validflag = "1";
- DataTable re = this.execute<DataTable>("com.hnshituo.pur.purplan.service.BidFunctionEvasService", "find", new object[] { pc,0,0 });
- GridHelper.CopyDataToDatatable(re, dataTable4, true);
- GridHelper.RefreshAndAutoSize(ultraGrid3);
- }
- /// <summary>
- /// 查询行
- /// </summary>
- /// <param name="strId"></param>
- /// <param name="strItemCode"></param>
- private void doQueryBasePriceC(String strId)
- {
- dataTable2.Clear();
- PurBidFunctionCEntity pc = new PurBidFunctionCEntity();
- pc.VersionNo = strId;
- pc.Validflag = "1";
- DataTable re = this.execute<DataTable>("com.hnshituo.pur.purplan.service.BidFunctionCService", "doQureyBidFunctionC", new object[] { pc });
- if (re.Rows.Count>0)
- {
- re.DefaultView.Sort = "ID asc";
- re = re.DefaultView.ToTable();
- }
- GridHelper.CopyDataToDatatable(re, dataTable2, true);
- comm.RefreshAndAutoSizeExceptColumns(ultraGrid2);
- }
- // 加载附件
- private void getOrderAppend(string strOrderId, string p)
- {
- fujian.Clear();
- OrderAppend append = new OrderAppend();
- append.OrderId = strOrderId;
- append.Validflag = "1";
- DataTable dt = this.execute<DataTable>("com.hnshituo.pur.order.service.OrderAppendService", "find", new object[] { append, 0, 0 });
- GridHelper.CopyDataToDatatable(dt, dataTable6, true);
- GridHelper.RefreshAndAutoSize(ultraGrid4);
- if (!String.IsNullOrEmpty(p))
- {
- PublicTools.publicPms.doActiveSelRow(ultraGrid4, "CERTPATH", p);
- }
- }
- /// <summary>
- /// 添加
- /// </summary>
- private void AddBasePriceM()
- {
- PurBidFunctionMEntity pm = new PurBidFunctionMEntity();
- if (String.IsNullOrEmpty(edtName.Text.Trim()))
- {
- MessageUtil.ShowTips("方案名称不能为空");
- edtName.Focus();
- return;
- }
-
- //if (String.IsNullOrEmpty(txt_remark.Text.Trim()))
- //{
- // MessageUtil.ShowTips("请填写申请部门意见");
- // txt_remark.Focus();
- // return;
- //}
-
- pm.Remark = txt_remark.Text.Trim();
- pm.Name = edtName.Text.Trim();
- pm.BuyerUnitCode =UserInfo.GetDeptid();
- pm.BuyerUnitDesc = this.UserInfo.GetDepartment();
- if (MessageUtil.ShowYesNoAndQuestion("确定新增?") != DialogResult.Yes)
- {
- return;
- }
- string strId = this.execute<string>("com.hnshituo.pur.utils.service.UtilsService", "getOddNumber_yymm", new object[] { "PUR_BID_FUNCTION_M", "ID", "FA", "4" });
- pm.Id = strId;
- pm.Flag = "0";
- pm.Validflag = "1";
- pm.Status = "1";
- pm.CreateName = UserInfo.GetUserName();
- pm.CreateTime = System.DateTime.Now;
- pm.CreateUserid = UserInfo.GetUserID();
- //DataTable re1 = this.execute<DataTable>("com.hnshituo.pur.purplan.service.BidFunctionMService", "doQureyBidFunctionM", new object[] { pm });
- CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionMService", "doInsert", new object[] { pm });
- if (re.Resultcode == 0)
- {
- MessageBox.Show("新增成功", "提示");
- QureyBasePriceM(re.Resultmsg);
- }
- else
- {
- MessageBox.Show("操作失败:" + re.Resultmsg, "提示");
- return;
- }
- }
- /// <summary>
- /// 提报
- /// </summary>
- private void doEffect()
- {
- if (ultraGrid1.ActiveRow==null)
- {
- MessageBox.Show("请选择方案", "提示");
- return;
- }
- string strStatus=getTaskStatusNum();
- if (strStatus != "1" && strStatus!="4")
- {
- MessageBox.Show("方案必须为待提报或者审批不通过状态才能提报", "提示");
- return;
- }
- PurBidFunctionMEntity pm = new PurBidFunctionMEntity();
- pm.Status = "2";
- pm.Id = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
- if (MessageUtil.ShowYesNoAndQuestion("确定提报招标方案【" + ultraGrid1.ActiveRow.Cells["NAME"].Value.ToString() + "】?") != DialogResult.Yes)
- {
- return;
- }
- CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionMService", "doUpdate", new object[] { pm });
- if (re.Resultcode == 0)
- {
- MessageBox.Show("提报成功", "提示");
- QureyBasePriceM(re.Resultmsg);
- }
- else
- {
- MessageBox.Show("操作失败:" + re.Resultmsg, "提示");
- return;
- }
- }
- /// <summary>
- /// 撤销提报
- /// </summary>
- private void doRevokeEffect()
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageBox.Show("请选择方案", "提示");
- return;
- }
- if (getTaskStatusNum() != "2")
- {
- MessageBox.Show("当前状态不为业务科长审批,不能撤销", "提示");
- return;
- }
- PurBidFunctionMEntity pm = new PurBidFunctionMEntity();
- pm.Status = "1";
- pm.Id = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
- if (MessageUtil.ShowYesNoAndQuestion("确定撤销提报招标方案【" + ultraGrid1.ActiveRow.Cells["NAME"].Value.ToString() + "】?") != DialogResult.Yes)
- {
- return;
- }
- CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionMService", "doUpdate", new object[] { pm });
- if (re.Resultcode == 0)
- {
- MessageBox.Show("撤销成功", "提示");
- QureyBasePriceM("");
- }
- else
- {
- MessageBox.Show("撤销失败:" + re.Resultmsg, "提示");
- return;
- }
- }
- /// <summary>
- /// 修改分配方案
- /// </summary>
- private void doUpdateBidFunctionM()
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageBox.Show("请选择方案", "提示");
- return;
- }
- string strStatus = getTaskStatusNum();
- if (strStatus != "1" && strStatus != "4")
- {
- MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
- return;
- }
- PurBidFunctionMEntity pm = new PurBidFunctionMEntity();
- pm.Remark = txt_remark.Text;
- pm.Id = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
- if (MessageUtil.ShowYesNoAndQuestion("确定修改招标方案【" + ultraGrid1.ActiveRow.Cells["NAME"].Value.ToString() + "】?") != DialogResult.Yes)
- {
- return;
- }
- CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionMService", "doUpdate", new object[] { pm });
- if (re.Resultcode == 0)
- {
- MessageBox.Show("修改成功", "提示");
- QureyBasePriceM(pm.Id);
- }
- else
- {
- MessageBox.Show("修改失败:" + re.Resultmsg, "提示");
- return;
- }
- }
- /// <summary>
- /// 保存评标人员意见
- /// </summary>
- private void SaveEvaRemark()
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageBox.Show("请选择方案", "提示");
- return;
- }
- string strStatus = getTaskStatusNum();
- if (strStatus != "1" && strStatus != "4")
- {
- MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
- return;
- }
- ultraGrid3.UpdateData();
- if (MessageUtil.ShowYesNoAndQuestion("确定修改评标人员意见?") != DialogResult.Yes)
- {
- return;
- }
- foreach (UltraGridRow row in ultraGrid3.Rows)
- {
- PurBidFunctionEvasEntity pm = new PurBidFunctionEvasEntity();
- pm.EvaMsg = row.Cells["EVAMSG"].Value.ToString();
- pm.EvaId = row.Cells["EVAID"].Value.ToString();
- CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionEvasService", "doUpdate", new object[] { pm });
- if (re.Resultcode == 0)
- {
- //QureyBasePriceM(re.Resultmsg);
- }
- else
- {
- MessageBox.Show("保存失败:" + re.Resultmsg, "提示");
- return;
- }
- }
- MessageBox.Show("保存成功", "提示");
- doQueryEva();
- }
- /// <summary>
- /// 删除
- /// </summary>
- private void DeleteBasePriceM()
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageBox.Show("请选择方案", "提示");
- return;
- }
- string strStatus = getTaskStatusNum();
- if (strStatus != "1" && strStatus != "4")
- {
- MessageBox.Show("方案必须为待提报或者审批不通过状态才能删除", "提示");
- return;
- }
- PurBidFunctionMEntity pm = new PurBidFunctionMEntity();
- pm.Validflag = "0";
- pm.Id = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
- if (MessageUtil.ShowYesNoAndQuestion("确定删除招标方案【" + ultraGrid1.ActiveRow.Cells["NAME"].Value.ToString() + "】?") != DialogResult.Yes)
- {
- return;
- }
- CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionMService", "doUpdate", new object[] { pm });
- if (re.Resultcode == 0)
- {
- MessageBox.Show("删除成功", "提示");
- QureyBasePriceM(re.Resultmsg);
- }
- else
- {
- MessageBox.Show("操作失败:" + re.Resultmsg, "提示");
- return;
- }
- }
- /// <summary>
- /// 提报
- /// </summary>
- private void doSure()
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageBox.Show("请选择方案", "提示");
- return;
- }
- if (getTaskStatusNum() != "2")
- {
- MessageBox.Show("当前状态不为业务科长审批", "提示");
- return;
- }
- string strTips = "";
- PurBidFunctionMEntity pm = new PurBidFunctionMEntity();
- pm.Id = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
- frmExamineShow Fex = new frmExamineShow();
- Fex.ShowDialog();
- if (Fex.Status == "2")//审批通过
- {
- pm.Status = "5";//去掉审批环节,提报后直接改状态为审批通过
- strTips = "通过";
- }
- else if (Fex.Status == "1")//审批不通过
- {
- pm.Status = "4";//去掉审批环节,提报后直接改状态为审批通过
- strTips = "不通过";
- pm.Examinemessage="业务科长审批不通过【"+Fex.ExamineMessage+"】";
- }
- else
- { return; }
- CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionMService", "doUpdate", new object[] { pm });
- if (re.Resultcode != 0)
- {
- MessageUtil.ShowTips("审批失败 " + re.Resultmsg);
- return;
- }
- MessageUtil.ShowTips("审批结果:" + strTips);
- QureyBasePriceM(pm.Id);
- }
- /// <summary>
- /// 提报
- /// </summary>
- private void doSure1()
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageBox.Show("请选择方案", "提示");
- return;
- }
- if (getTaskStatusNum() != "5")
- {
- MessageBox.Show("当前状态不为主管部长审批", "提示");
- return;
- }
- string strTips = "";
- PurBidFunctionMEntity pm = new PurBidFunctionMEntity();
- pm.Id = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
- frmExamineShow Fex = new frmExamineShow();
- Fex.ShowDialog();
- if (Fex.Status == "2")//审批通过
- {
- pm.Status = "3";//去掉审批环节,提报后直接改状态为审批通过
- strTips = "通过";
- }
- else if (Fex.Status == "1")//审批不通过
- {
- pm.Status = "4";//去掉审批环节,提报后直接改状态为审批通过
- pm.Examinemessage = "主管部长审批不通过【" + Fex.ExamineMessage + "】";
- strTips = "不通过";
- }
- else
- { return; }
- CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionMService", "doUpdate", new object[] { pm });
- if (re.Resultcode != 0)
- {
- MessageUtil.ShowTips("审批失败 " + re.Resultmsg);
- return;
- }
- MessageUtil.ShowTips("审批结果:" + strTips);
- QureyBasePriceM(pm.Id);
- }
- /// <summary>
- /// 清空编辑区
- /// </summary>
- private void clearTab()
- {
- dataTable1.Rows.Clear();
- dataTable2.Rows.Clear();
- dataTable4.Rows.Clear();
- dataTable6.Rows.Clear();
- edtName.Clear();
- //txt_effectTime.Value = DateTime.Now;
- txt_remark.Clear();
- }
- private void ultraGrid1_AfterRowActivate(object sender, System.EventArgs e)
- {
- if (ultraGrid1.ActiveRow == null)
- {
- return;
- }
- String strId = ultraGrid1.ActiveRow.Cells["id"].Value.ToString();
- if (String.IsNullOrEmpty(strId))
- {
- return;
- }
- PurBidFunctionMEntity pp = this.execute<PurBidFunctionMEntity>("com.hnshituo.pur.purplan.service.BidFunctionMService", "findById", new object[] { strId });
- //判断当前激活行是否为空
- edtName.Text = pp.Name;
- txt_remark.Text = pp.Remark == null ? null : pp.Remark.Replace("\n", "\r\n");
- doQueryEva();
- doQueryBasePriceC(strId);
- getOrderAppend(strId, "");
- }
- private void ultraButton1_Click(object sender, System.EventArgs e)
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageBox.Show("请选择方案", "提示");
- return;
- }
- string strStatus = getTaskStatusNum();
- if (strStatus != "1" && strStatus != "4")
- {
- MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
- return;
- }
- if (string.IsNullOrEmpty(txt_EVA_ORG_ID.Text))
- {
- MessageUtil.ShowTips("请选择人员");
- return;
- }
- if (string.IsNullOrEmpty(cmb_EVA_ROLE_NAME.Text))
- {
- MessageUtil.ShowTips("请选择角色");
- return;
- }
- if (dataTable4.Rows.Contains(txt_EVA_USERID.Text))
- {
- MessageUtil.ShowTips("已经存在同一个人员,不要重复添加");
- return;
- }
- else
- {
- ArrayList al_Eva = new ArrayList();
- PurBidFunctionEvasEntity TaskEvaUsersEntity = new PurBidFunctionEvasEntity();
- string strTaskName = this.execute<string>("com.hnshituo.pur.utils.service.UtilsService", "getOddNumber_yymm", new object[] { "PUR_BID_FUNCTION_EVAS", "EVA_ID", "GNEVA", "3" });
- TaskEvaUsersEntity.EvaId = strTaskName;
- TaskEvaUsersEntity.VersionNo = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
- TaskEvaUsersEntity.Validflag = "1";
- TaskEvaUsersEntity.CreateName = UserInfo.GetUserName();
- TaskEvaUsersEntity.CreateUserid = UserInfo.GetUserID();
- TaskEvaUsersEntity.CreateTime = System.DateTime.Now;
- TaskEvaUsersEntity.EvaRoleId = cmb_EVA_ROLE_NAME.Value.ToString();//角色Id
- TaskEvaUsersEntity.EvaRoleName = cmb_EVA_ROLE_NAME.Text.ToString();//角色名称
- TaskEvaUsersEntity.EvaUserId = txt_EVA_USERID.Text;//用户Id
- TaskEvaUsersEntity.EvaUserName = txt_EVA_USERNAME.Text;//用户名称
- TaskEvaUsersEntity.EvaOrgId = txt_EVA_ORG_ID.Text;//科室Id
- TaskEvaUsersEntity.EvaOrgName = txt_EVA_ORG_NAME.Text;//科室名称
- al_Eva.Add(TaskEvaUsersEntity);
- for (int i = 0; i < al_Eva.Count; i++)
- {
- CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionEvasService", "doInsert", new object[] { TaskEvaUsersEntity });
- if (re.Resultcode != 0)
- {
- MessageUtil.ShowTips("插入失败 " + re.Resultmsg);
- return;
- }
- }
- MessageUtil.ShowTips("添加成功!");
- doQueryEva();
- //清空控件
- txt_EVA_ORG_ID.Text = null;
- txt_EVA_ORG_NAME.Text = null;
- txt_EVA_USERID.Text = null;
- txt_EVA_USERNAME.Text = null;
- cmb_EVA_ROLE_NAME.Value = null;
- }
- ultraGrid3.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.AllRowsInBand);
- }
- private void btnSelEvaGroup_Click(object sender, System.EventArgs e)
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageBox.Show("请选择方案", "提示");
- return;
- }
- string strStatus = getTaskStatusNum();
- if (strStatus != "1" && strStatus != "4")
- {
- MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
- return;
- }
- frmPopSelEvaGroup frm = new frmPopSelEvaGroup(this.ob);
- frm.ShowDialog();
- ArrayList al_Eva = new ArrayList();
- if (frm.dtEvaGroup != null)
- {
- DataTable dt = frm.dtEvaGroup;
- //string strTaskName = this.execute<string>("com.hnshituo.pur.utils.service.UtilsService", "getOddNumber_yymm", new object[] { "PUR_BID_FUNCTION_EVAS", "EVA_ID", "GNEVA", "3" });
- //添加评标人员
- foreach (DataRow dr in dt.Rows)
- {
- if (!dataTable4.Rows.Contains(dr["EVAUSERID"]))
- {
- PurBidFunctionEvasEntity TaskEvaUsersEntity = new PurBidFunctionEvasEntity();
- //TaskEvaUsersEntity.EvaId = strTaskName;
- TaskEvaUsersEntity.VersionNo = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
- TaskEvaUsersEntity.Validflag = "1";
- TaskEvaUsersEntity.CreateName = UserInfo.GetUserName();
- TaskEvaUsersEntity.CreateUserid = UserInfo.GetUserID();
- TaskEvaUsersEntity.CreateTime = System.DateTime.Now;
- TaskEvaUsersEntity.EvaRoleId = dr["EVAROLEID"].ToString();//评审角色编号
- TaskEvaUsersEntity.EvaRoleName = dr["EVAROLENAME"].ToString();//评审角色
- TaskEvaUsersEntity.EvaOrgId = dr["EVAORGID"].ToString();//评审人部门编号
- TaskEvaUsersEntity.EvaOrgName = dr["EVAORGNAME"].ToString();//评审人部门
- TaskEvaUsersEntity.EvaUserName = dr["EVAUSERNAME"].ToString();//评审人
- TaskEvaUsersEntity.EvaUserId = dr["EVAUSERID"].ToString();//评审人
- al_Eva.Add(TaskEvaUsersEntity);
- }
- }
- }
- if (al_Eva.Count == 0)
- {
- return;
- }
- CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionEvasService", "doInsertBFEvas", new object[] { al_Eva });
- if (re.Resultcode != 0)
- {
- MessageUtil.ShowTips("插入失败 " + re.Resultmsg);
- return;
- }
- MessageUtil.ShowTips("添加成功!");
- doQueryEva();
- //清空控件
- txt_EVA_ORG_ID.Text = null;
- txt_EVA_ORG_NAME.Text = null;
- txt_EVA_USERID.Text = null;
- txt_EVA_USERNAME.Text = null;
- cmb_EVA_ROLE_NAME.Value = null;
- }
- /// <summary>
- /// 删除评标人员
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ultraButton2_Click(object sender, System.EventArgs e)
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageBox.Show("请选择方案", "提示");
- return;
- }
- string strStatus = getTaskStatusNum();
- if (strStatus != "1" && strStatus != "4")
- {
- MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
- return;
- }
- PurBidFunctionEvasEntity TaskEvaUsersEntity = new PurBidFunctionEvasEntity();
- TaskEvaUsersEntity.EvaId = ultraGrid3.ActiveRow.Cells["EvaId"].Value.ToString();
- TaskEvaUsersEntity.Validflag = "0";
- if (MessageUtil.ShowYesNoAndQuestion("确定删除人员" + ultraGrid3.ActiveRow.Cells["EVAUSERNAME"].Value.ToString() + "?") != DialogResult.Yes)
- {
- return;
- }
- CoreResult re = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionEvasService", "doUpdate", new object[] { TaskEvaUsersEntity });
- if (re.Resultcode != 0)
- {
- MessageUtil.ShowTips("删除失败 " + re.Resultmsg);
- return;
- }
- MessageUtil.ShowTips("删除成功!");
- doQueryEva();
- }
- private void txt_certPath_EditorButtonClick(object sender, EditorButtonEventArgs e)
- {
- try
- {
- if (e.Button.Key.ToLower().Equals("insert"))
- {
- OpenFileDialog file = new OpenFileDialog();
- file.Multiselect = false;
- DialogResult drStat;
- drStat = file.ShowDialog();
- if (drStat == DialogResult.OK)
- {
- fileName = file.FileName;
- string filena = System.IO.Path.GetFileName(fileName);
- txt_certPath.Text = filena;
- }
- }
- }
- catch (Exception ex)
- {
- MessageUtil.ShowTips("操作失败:" + ex);
- }
- }
- private void ultraButton3_Click(object sender, System.EventArgs e)
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageBox.Show("请选择方案", "提示");
- return;
- }
- string strStatus = getTaskStatusNum();
- if (strStatus != "1" && strStatus != "4")
- {
- MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
- return;
- }
- if (ultraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowTips("未选择方案");
- return;
- }
- string strId = ultraGrid1.ActiveRow.GetValue("id");
- if (String.IsNullOrEmpty(strId))
- {
- MessageUtil.ShowTips("方案ID为空");
- return;
- }
- String filena = txt_certPath.Text.ToString().Trim();
- if (String.IsNullOrEmpty(filena) || String.IsNullOrEmpty(fileName))
- {
- MessageUtil.ShowTips("请选择待上传文件");
- return;
- }
- OrderAppend sat = new OrderAppend();
- sat.OrderId = strId;
- String filePathNew = "Pms/CERT/" + strId + "/";
- sat.CertPath = filena;
- sat.CertPathOld = filePathNew + filena;
- sat.CreateUserid = UserInfo.GetUserID();
- sat.CreateName = UserInfo.GetUserName();
- sat.CreateTime = DateTime.Now;
- sat.Validflag = "1";
- sat.CertDesc = txt_CERTDESC.Text.Trim();
- if (GetCraftFileCraftNoCnt(filena, strId) > 0)
- {
- MessageUtil.ShowTips("方案已存在该附件文件:" + filena);
- return;
- }
- List<FileBean> list = new List<FileBean>();
- FileBean bean = new FileBean();
- bean = new FileBean();
- bean.setFileName(filena);
- bean.setPathName(filePathNew);
- bean.setFile(FileHelper.FileToArray(fileName));
- list.Add(bean);
- bool isSuccess = Core.Mes.Client.Comm.Server.FileHelper.Upload(list);
- if (isSuccess)
- {
- //开始写数据库
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.order.service.OrderAppendService", "insert_append", new object[] { sat });
- if (crt.Resultcode != 0)
- {
- MessageUtil.ShowTips("上传失败:" + crt.Resultmsg);
- }
- else
- {
- MessageUtil.ShowTips("上传成功");
- ClearTab5();
- }
- }
- else
- {
- MessageBox.Show("上传失败");
- }
- //刷新界面并激活当前行
- getOrderAppend(sat.OrderId, sat.CertPath);
- }
- /// <summary>
- /// 判断是否之前已提交相同的文件
- /// </summary>
- /// <param name="craftNo"></param>
- /// <returns></returns>
- private int GetCraftFileCraftNoCnt(string CERT_PATH, string orderId)
- {
- OrderAppend sat = new OrderAppend();
- sat.CertPath = CERT_PATH;
- sat.OrderId = orderId;
- sat.Validflag = "1";
- int dt = this.execute<int>("com.hnshituo.pur.order.service.OrderAppendService", "count", new object[] { sat });
- return dt;
- }
- private void ClearTab5()
- {
- txt_certPath.Clear();
- txt_CERTDESC.Clear();
- fileName = "";
- }
- private void ultraButton4_Click(object sender, System.EventArgs e)
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageBox.Show("请选择方案", "提示");
- return;
- }
- string strStatus = getTaskStatusNum();
- if (strStatus != "1" && strStatus != "4")
- {
- MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
- return;
- }
- UltraGridRow uge = ultraGrid1.ActiveRow;
- if (uge == null)
- {
- MessageUtil.ShowTips("请选择方案!");
- return;
- }
- String strId = uge.Cells["id"].Value.ToString().Trim();
- if (String.IsNullOrEmpty(strId))
- {
- MessageUtil.ShowTips("该方案ID为空!");
- return;
- }
- UltraGridRow rowAppend = ultraGrid4.ActiveRow;
- if (rowAppend == null)
- {
- MessageUtil.ShowTips("请选择需删除的附件!");
- return;
- }
- String strAppendID = rowAppend.Cells["ID"].Value.ToString().Trim();
- String strcertPath = rowAppend.Cells["CERTPATH"].Value.ToString().Trim();
- String strCertPathOld = rowAppend.Cells["CERTPATHOLD"].Value.ToString().Trim();
- if (String.IsNullOrEmpty(strAppendID))
- {
- MessageUtil.ShowTips("该价格政策附件编号为空!");
- return;
- }
- if (String.IsNullOrEmpty(strCertPathOld))
- {
- MessageUtil.ShowTips("未获取到任务单附件地址信息!");
- return;
- }
- //验证任务单头是否可以增删改
- if (testOrderAppendStatus(strAppendID, 1) == false)
- {
- return;
- }
- OrderAppend append = new OrderAppend();
- append.Id = strAppendID;
- append.Validflag = "0";
- append.DeleteName = UserInfo.GetUserName();
- append.DeleteTime = DateTime.Now;
- append.DeleteUserid = UserInfo.GetUserID();
- if (MessageUtil.ShowYesNoAndQuestion("确定删除附件:" + strcertPath + "?") != DialogResult.Yes)
- {
- return;
- }
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.order.service.OrderAppendService", "delete_append", new object[] { append });
- if (crt.Resultcode != 0)
- {
- MessageUtil.ShowTips("删除失败!" + crt.Resultmsg);
- return;
- }
- else
- {
- bool isSuccess = Core.Mes.Client.Comm.Server.FileHelper.Delete(strCertPathOld);
- if (isSuccess)
- {
- MessageUtil.ShowTips("删除成功");
- }
- else
- {
- MessageBox.Show("删除成功");
- }
- }
- getOrderAppend(strId, "");
- }
- /// <summary>
- /// 验证价格政策输入数据的有效性
- /// </summary>
- /// <returns></returns>
- private bool testOrderAppendStatus(String strId, int p)// 验证合同附件
- {
- OrderAppend append = this.execute<OrderAppend>("com.hnshituo.pur.order.service.OrderAppendService", "findById", new object[] { strId });
- if (append == null)
- {
- MessageUtil.ShowTips("未发现价格政策附件:" + strId + "信息记录,可能已作废");
- return false;
- }
- if (append.Validflag != "1")
- {
- MessageUtil.ShowTips("价格政策附件:" + strId + "信息记录可能已作废");
- return false;
- }
- if (append.CreateUserid != UserInfo.GetUserID())
- {
- MessageUtil.ShowTips("非本人上传价格政策附件无权限进行增删改");
- return false;
- }
- if (p == 1)
- {
- }
- else
- {
- MessageUtil.ShowTips("未知参数:" + p + "");
- return false;
- }
- return true;
- }
- private void craftImg_EditorButtonClick(object sender, EditorButtonEventArgs e)
- {
- try
- {
- UltraGridRow row = ultraGrid4.ActiveRow;
- string filePathOld = row.GetValue("certPathOld");
- if (e.Button.Key.ToLower().Equals("select"))
- {
- FrmPopFileShow down = new FrmPopFileShow(this.ob, filePathOld);
- down.DeleteButton.Visible = false;
- down.ShowDialog();
- }
- }
- catch (Exception ex)
- {
- MessageUtil.ShowTips("操作失败:" + ex);
- }
- }
- /// <summary>
- /// 获取最大排名+1
- /// </summary>
- /// <returns></returns>
- private int OrderNum()
- {
- PurBidFunctionCEntity pc = new PurBidFunctionCEntity();
- pc.VersionNo = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
- pc.Validflag = "1";
- int num = this.execute<int>("com.hnshituo.pur.purplan.service.BidFunctionCService", "count", new object[] { pc });
- num = num + 1;
- return num;
- }
- //新增排名
- private void ultraButton5_Click(object sender, System.EventArgs e)
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageBox.Show("请选择方案", "提示");
- return;
- }
- string strStatus = getTaskStatusNum();
- if (strStatus != "1" && strStatus != "4")
- {
- MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
- return;
- }
- //判定总分配比例不能超过100
- PurBidFunctionCEntity pc1 = new PurBidFunctionCEntity();
- pc1.VersionNo = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
- pc1.Validflag = "1";
- DataTable dt = this.execute<DataTable>("com.hnshituo.pur.purplan.service.BidFunctionCService", "find", new object[] { pc1,0,0 });
- double numAssignValue = 0;
- foreach(DataRow dr in dt.Rows)
- {
- double d = double.Parse(dr["AssignValue"].ToString());
- numAssignValue += d;
- }
- int num = OrderNum();
- PurBidFunctionCEntity pc = new PurBidFunctionCEntity();
- string strId = this.execute<string>("com.hnshituo.pur.utils.service.UtilsService", "getOddNumber_yymm", new object[] { "PUR_BID_FUNCTION_C", "ID", "GZ", "4" });
- pc.Id = strId;
- pc.VersionNo = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
- pc.Validflag = "1";
- pc.CreateName = UserInfo.GetUserName();
- pc.CreateTime = System.DateTime.Now;
- pc.CreateUserid = UserInfo.GetUserID();
- pc.Remark = txtRemark_BidFunctionC.Text;
- pc.AssignName = num.ToString();
- if (ultraNumericEditor1.Value == null )
- {
- MessageUtil.ShowTips("请输入>0的排名比例");
- return;
- }
- else
- {
- numAssignValue += double.Parse(ultraNumericEditor1.Value.ToString());
- pc.AssignValue = ultraNumericEditor1.Value.ToString();
- if(numAssignValue>100)
- {
- MessageUtil.ShowTips("所有的名次比例总和不能>100%");
- return;
- }
- }
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionCService", "doInsert", new object[] { pc });
- if (crt.Resultcode != 0)
- {
- MessageUtil.ShowTips("插入失败:" + crt.Resultmsg);
- }
- else
- {
- MessageUtil.ShowTips("插入成功");
- }
- doQueryBasePriceC(pc.VersionNo);
- }
- private void ultraButton7_Click(object sender, System.EventArgs e)
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageBox.Show("请选择方案", "提示");
- return;
- }
- string strStatus = getTaskStatusNum();
- if (strStatus != "1" && strStatus != "4")
- {
- MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
- return;
- }
- //判定总分配比例不能超过100
-
- PurBidFunctionCEntity pc = new PurBidFunctionCEntity();
- pc.Id = ultraGrid2.ActiveRow.Cells["Id"].Value.ToString();
- pc.Remark = txtRemark_BidFunctionC.Text;
- pc.UpdateName = UserInfo.GetUserName();
- pc.UpdateUserid = UserInfo.GetUserID();
- if (ultraNumericEditor1.Value == null)
- {
- MessageUtil.ShowTips("请输入排名比例");
- return;
- }
- else
- {
- pc.AssignValue = ultraNumericEditor1.Value.ToString();
- PurBidFunctionCEntity pc1 = new PurBidFunctionCEntity();
- pc1.VersionNo = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
- pc1.Validflag = "1";
- DataTable dt = this.execute<DataTable>("com.hnshituo.pur.purplan.service.BidFunctionCService", "find", new object[] { pc1, 0, 0 });
- double numAssignValue = 0;
- foreach (DataRow dr in dt.Rows)
- {
- if (ultraGrid2.ActiveRow.Cells["Id"].Value.ToString() == dr["id"].ToString())
- {
- double d = double.Parse(ultraNumericEditor1.Value.ToString());
- numAssignValue += d;
- }
- else
- {
- double d = double.Parse(dr["AssignValue"].ToString());
- numAssignValue += d;
- }
-
- }
- if (numAssignValue > 100)
- {
- MessageUtil.ShowTips("所有的名次比例总和不能>100%");
- return;
- }
- }
- if (MessageUtil.ShowYesNoAndQuestion("确定修改" + ultraGrid2.ActiveRow.Cells["ASSIGNNAME"].Value.ToString() + "的比例为"+pc.AssignValue+"?") != DialogResult.Yes)
- {
- return;
- }
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionCService", "doUpdate", new object[] { pc });
- if (crt.Resultcode != 0)
- {
- MessageUtil.ShowTips("修改失败:" + crt.Resultmsg);
- }
- else
- {
- MessageUtil.ShowTips("修改成功");
- }
- doQueryBasePriceC(ultraGrid1.ActiveRow.Cells["ID"].Value.ToString());
- }
- private void ultraButton6_Click(object sender, System.EventArgs e)
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageBox.Show("请选择方案", "提示");
- return;
- }
- string strStatus = getTaskStatusNum();
- if (strStatus != "1" && strStatus != "4")
- {
- MessageBox.Show("方案必须为待提报或者审批不通过状态才能修改", "提示");
- return;
- }
- PurBidFunctionCEntity pc = new PurBidFunctionCEntity();
- pc.Validflag = "1";
- pc.VersionNo = ultraGrid1.ActiveRow.Cells["Id"].Value.ToString();
- pc.AssignName = (OrderNum() - 1).ToString();
- DataTable dt=this.execute<DataTable>("com.hnshituo.pur.purplan.service.BidFunctionCService", "find", new object[] { pc, 0, 0 });
- if (dt.Rows.Count<1)
- {
- MessageUtil.ShowTips("删除失败:未找到可删除的排名");
- return;
- }
- pc.Id = dt.Rows[0]["ID"].ToString();
- if (MessageUtil.ShowYesNoAndQuestion("确定删除第" + dt.Rows[0]["ASSIGNNAME"].ToString() + "名分配规则?") != DialogResult.Yes)
- {
- return;
- }
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.BidFunctionCService", "doDelete", new object[] { pc });
- if (crt.Resultcode != 0)
- {
- MessageUtil.ShowTips("删除失败:" + crt.Resultmsg);
- }
- else
- {
- MessageUtil.ShowTips("删除成功");
- }
- doQueryBasePriceC(ultraGrid1.ActiveRow.Cells["ID"].Value.ToString());
- }
- private void txt_EVA_USERNAME_EditorButtonClick(object sender, EditorButtonEventArgs e)
- {
- SetectManByDept frm = new SetectManByDept(this.ob, this.UserInfo.GetDeptid());
- frm.ShowDialog();
- txt_EVA_ORG_ID.Text = frm.StrDeptId;
- txt_EVA_ORG_NAME.Text = frm.StrDeptName;
- txt_EVA_USERID.Text = frm.StrUserID;
- txt_EVA_USERNAME.Text = frm.StrUserName;
- }
- private void ultraGrid2_Click(object sender, System.EventArgs e)
- {
- this.ultraTabControl1.SelectedTab = this.ultraTabControl1.Tabs["1"];
- }
- private void ultraGrid1_Click(object sender, System.EventArgs e)
- {
- this.ultraTabControl1.SelectedTab = this.ultraTabControl1.Tabs["0"];
- }
- private void ultraGrid3_Click(object sender, System.EventArgs e)
- {
- this.ultraTabControl1.SelectedTab = this.ultraTabControl1.Tabs["2"];
- }
- private void ultraGrid4_Click(object sender, System.EventArgs e)
- {
- this.ultraTabControl1.SelectedTab = this.ultraTabControl1.Tabs["3"];
- }
- public string getTaskStatusNum()
- {
- string strTaskStatus = "";
- PurBidFunctionMEntity M_PurTaskM = new PurBidFunctionMEntity();
- M_PurTaskM = this.execute<PurBidFunctionMEntity>("com.hnshituo.pur.purplan.service.BidFunctionMService", "findById", new object[] { ultraGrid1.ActiveRow.Cells["ID"].Value.ToString() });
- if (M_PurTaskM != null)
- {
- strTaskStatus = M_PurTaskM.Status;
- }
- return strTaskStatus;
- }
- }
- }
|