| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990 |
- 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 frmPop_BID_FUNCTION : FrmPmsBase
- {
- string fileName = "";
- public string strSelName = "";
- public string strSelId = "";
- public frmPop_BID_FUNCTION()
- {
- InitializeComponent();
- }
- public frmPop_BID_FUNCTION(OpeBase ob)
- {
- InitializeComponent();
- this.ob = ob;
- this.barsManagerButon.Visible = true;
- ultraExpandableGroupBox1.Visible = false;
- }
- /// <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":
- 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 "Query":
- {
- QureyBasePriceM("");
- }
- break;
- case "conFirmation":
- {
- SelectFunction();
- }
- break;
- case "ESC":
- {
- this.Close();
- }
- break;
- }
- }
- private void SelectFunction()
- {
- if(ultraGrid1.ActiveRow==null)
- {
- MessageUtil.ShowTips("请选择方案");
- return;
- }
- if(ultraGrid1.ActiveRow.Cells["status"].Value.ToString()!="已审批")
- {
- MessageUtil.ShowTips("方案未审批通过不能选择");
- return;
- }
- strSelName = ultraGrid1.ActiveRow.Cells["NAME"].Value.ToString();
- strSelId = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
- this.Close();
- }
- 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);
- }
- // 加载附件
- 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();
- 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()
- {
- 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()
- {
- 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()
- {
- 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()
- {
- 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()
- {
- 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()
- {
- 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";//去掉审批环节,提报后直接改状态为审批通过
- 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()
- {
- 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 (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)
- {
- 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)
- {
- 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)
- {
- 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)
- {
- 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)
- {
- 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("请输入排名比例");
- return;
- }
- else
- {
- pc.AssignValue = ultraNumericEditor1.Value.ToString();
- }
- 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)
- {
- 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();
- }
- if (MessageUtil.ShowYesNoAndQuestion("确定修改" + ultraGrid2.ActiveRow.Cells["ASSIGNNAME"].Value.ToString() + "的比例?") != 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)
- {
- 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"];
- }
- }
- }
|