| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655 |
- 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 CoreFS.CA06;
- using com.steering.pss.sale.order.model;
- using Core.Mes.Client.Comm.Tool;
- using Core.Mes.Client.Comm.Server;
- using System.Collections;
- using Infragistics.Win.UltraWinGrid;
- using Infragistics.Win.UltraWinEditors;
- using Core.StlMes.Client.SaleComm;
- namespace Core.StlMes.Client.SaleOrder.ReviewForm
- {
- public partial class frmOrderColligateInfomation : FrmBase
- {
- UltraComboEditor uceA = new UltraComboEditor();
- UltraComboEditor uceB = new UltraComboEditor();
- public frmOrderColligateInfomation()
- {
- InitializeComponent();
- this.IsLoadUserView = true;
- }
- /// <summary>
- /// 重写基类toolBar方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- DoQuery();
- break;
- case "Print":
- DoLink();
- break;
- case "Refresh":
- DoRefresh();
- break;
- case "PrintOrder":
- PrintOrder();
- break;
- case "PrintOrderA4":
- PrintOrderA4();
- break;
- case "PrintBackA4":
- PrintBackA4();
- break;
- case "PrintOrderPreview":
- PrintOrderPreview();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- private void DoQuery()
- {
- DoQueryHead();
- }
- private void DoSave()
- {
- ultraGridOrderLine.UpdateData();
- UltraGridRow ugrHead = ultraGridOrderHead.ActiveRow;
- if (ugrHead == null)
- {
- MessageUtil.ShowWarning("请选择合同");
- return;
- }
- IQueryable<UltraGridRow> checkRows = ultraGridOrderLine.Rows.AsQueryable().Where(" CHC = 'True'");
- if (checkRows.Count() == 0)
- {
- MessageUtil.ShowWarning("请选择合同行");
- return;
- }
- ArrayList list = new ArrayList();
- String orderSeq = "";
- foreach (UltraGridRow ugr in checkRows)
- {
- PlnOrdCraftFileEntity fileEntity = new PlnOrdCraftFileEntity();
- fileEntity.CraftFileFlagCode = ugr.Cells["CraftFileFlagCode"].Value.ToString().Trim();
- fileEntity.CraftFileFlagNm = ugr.Cells["CraftFileFlagNm"].Value.ToString().Trim();
- fileEntity.CraftFileMan = ugr.Cells["CraftFileMan"].Value.ToString().Trim();
- fileEntity.CraftFileNo = ugr.Cells["CraftFileNo"].Value.ToString().Trim();
- fileEntity.CraftFilePath = ugr.Cells["CraftFilePath"].Value.ToString().Trim();
- fileEntity.CraftFileTypeCode = ugr.Cells["CraftFileTypeCode"].Value.ToString().Trim();
- fileEntity.CraftFileTypeNm = ugr.Cells["CraftFileTypeNm"].Value.ToString().Trim();
- fileEntity.OrderSeq = ugr.Cells["OrderSeq"].Value.ToString().Trim();
- fileEntity.OrdLnPk = ugr.Cells["OrdLnPk"].Value.ToString().Trim();
- fileEntity.OrdPk = ugr.Cells["OrdPk"].Value.ToString().Trim();
- fileEntity.OrderNo = ugrHead.Cells["OrderNo"].Value.ToString();
- fileEntity.CreateName = this.UserInfo.GetUserName();
- fileEntity.UpdateName = this.UserInfo.GetUserName();
- list.Add(fileEntity);
- orderSeq = fileEntity.OrderSeq.ToString();
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否保存?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.sale.order.CoreOrderColligateInfomation";
- ccp.MethodName = "saveCraftFile";
- ccp.ServerParams = new object[] { list };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- DoQueryLine(ugrHead.Cells["OrdPk"].Value.ToString());
- foreach (UltraGridRow ugrline in ultraGridOrderLine.Rows)
- {
- if (ugrline.Cells["OrderSeq"].Text.Equals(orderSeq))
- {
- ugrline.Activate();
- }
- }
- }
- }
- private void DoRefresh()
- {
- if (ultraDateTimeEditorBegin.Value == null || ultraDateTimeEditorEnd.Value == null)
- {
- MessageUtil.ShowWarning("请选择正确的时间");
- return;
- }
- ultraComboEditorOrderNo.DataSource = null;
- String beginTime = ultraDateTimeEditorBegin.Value.ToString();
- String endTime = ultraDateTimeEditorEnd.Value.ToString();
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreConReviewInfo.getOrdNoByTime", new Object[] { beginTime, endTime }, this.ob);
- ultraComboEditorOrderNo.DataSource = dt;
- }
- private void frmOrderInfomation_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<SlmOrderHeadEntity>(ultraGridOrderHead.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<SlmOrderLineNextEntity>(ultraGridOrderLine.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<SlmOrderLineDeliveryEntity>(ultraGridOrderDeliry.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<SlmOrderDeliveryTransitEntity>(ultraGridOrderTait.DisplayLayout.Bands[0]);
- EntityHelper.ShowGridCaption<SlmOrderPriceListEntity>(ultraGridOrderPrice.DisplayLayout.Bands[0]);
- InitDate();
- InitCombo();
- }
- /// <summary>
- /// 初始时间
- /// </summary>
- private void InitDate()
- {
- ultraCheckEditorOrderNo.Checked = true;
- ultraDateTimeEditorBegin.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddMonths(-1);
- ultraDateTimeEditorEnd.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(1).AddSeconds(-1);
- DoRefresh();
- }
- private void DoQueryHead()
- {
- ArrayList param = new ArrayList();
- if (ultraCheckEditorOrderNo.Checked)
- {
- param.Add(ultraComboEditorOrderNo.Text.Trim());
- }
- else
- {
- param.Add("");
- }
- if (ultraDateTimeEditorBegin.Value == null || ultraDateTimeEditorEnd.Value == null)
- {
- MessageUtil.ShowWarning("请选择正确的时间");
- return;
- }
- string timeBegin = "";
- string timeEnd = "";
- timeBegin = "1000-01-01 00:00:01";
- timeEnd = "9999-12-31 23:59:59";
- if (chkTime.Checked)
- {
- timeBegin = ultraDateTimeEditorBegin.DateTime.ToString("yyyy-MM-dd") + " 00:00:01";
- timeEnd = ultraDateTimeEditorEnd.DateTime.ToString("yyyy-MM-dd") + " 23:59:59";
- }
- param.Add(timeBegin);
- param.Add(timeEnd);
- int num = 0;
- if (radioBal.Checked)
- num = 0;
- if (radioAll.Checked)
- num = 1;
- List<SlmOrderHeadEntity> listSorce = EntityHelper.GetData<SlmOrderHeadEntity>(
- "com.steering.pss.sale.order.CoreOrderColligateInfomation.getOrderHeadInfo", new object[] { param, this.ValidDataPurviewIds, num }, this.ob);
- slmOrderHeadEntityBindingSource.DataSource = listSorce;
- }
- private void DoQueryLine(String ordPk)
- {
- List<SlmOrderLineNextEntity> listSorce = EntityHelper.GetData<SlmOrderLineNextEntity>(
- "com.steering.pss.sale.order.CoreOrderColligateInfomation.getOrderLineInfo", new object[] { ordPk }, this.ob);
- slmOrderLineNextEntityBindingSource.DataSource = listSorce;
- SetColumnReadOnly();
- if (listSorce.Count == 0)
- {
- DoQueryPrice("");
- DoQueryDelivry("");
- }
- }
- private void DoQueryPrice(String ordLnPk)
- {
- List<SlmOrderPriceListEntity> listSorce = EntityHelper.GetData<SlmOrderPriceListEntity>(
- "com.steering.pss.sale.order.CoreOrderColligateInfomation.getOrderPriceDetail", new object[] { ordLnPk }, this.ob);
- slmOrderPriceListEntityBindingSource.DataSource = listSorce;
- }
- private void ultraCheckEditorOrderNo_CheckedChanged(object sender, EventArgs e)
- {
- if (ultraCheckEditorOrderNo.Checked)
- {
- ultraComboEditorOrderNo.Enabled = true;
- }
- else
- {
- ultraComboEditorOrderNo.Enabled = false;
- }
- }
- private void ultraGridOrderHead_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow ugr = ultraGridOrderHead.ActiveRow;
- if (ugr == null)
- {
- return;
- }
- String priceNo = ugr.Cells["PriceNo"].Value.ToString().Trim();
- if (priceNo.Length > 0)
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderColligateInfomation.getOrderPriceInfo", new Object[] { priceNo }, this.ob);
- if (dt != null && dt.Rows.Count > 0)
- {
- ultraLabel1.Text = dt.Rows[0][0].ToString();
- }
- else
- {
- ultraLabel1.Text = "";
- }
- }
- else
- {
- ultraLabel1.Text = "";
- }
- String ordPk = ugr.Cells["OrdPk"].Value.ToString().Trim();
- DoQueryLine(ordPk);
- }
- private void ultraGridOrderLine_AfterRowActivate(object sender, EventArgs e)
- {
- ultraGridOrderLine.UpdateData();
- UltraGridRow ugr = ultraGridOrderLine.ActiveRow;
- if (ugr == null)
- {
- return;
- }
- String ordLnPk = ugr.Cells["OrdLnPk"].Value.ToString().Trim();
- DoQueryPrice(ordLnPk);
- DoQueryDelivry(ordLnPk);
- }
- private void DoQueryDelivry(String ordLnPk)
- {
- List<SlmOrderLineDeliveryEntity> listSorce = EntityHelper.GetData<SlmOrderLineDeliveryEntity>(
- "com.steering.pss.sale.order.CoreOrderInfomation.getOrderDelivyInfo", new object[] { ordLnPk }, this.ob);
- slmOrderLineDeliveryEntityBindingSource.DataSource = listSorce;
- if (listSorce.Count == 0)
- {
- DoQuerygTranSit("");
- }
- }
- private void DoQuerygTranSit(String ordLnDlyPk)
- {
- List<SlmOrderDeliveryTransitEntity> listSorce = EntityHelper.GetData<SlmOrderDeliveryTransitEntity>(
- "com.steering.pss.sale.order.CoreOrderInfomation.getOrderTranSit", new object[] { ordLnDlyPk }, this.ob);
- slmOrderDeliveryTransitEntityBindingSource.DataSource = listSorce;
- }
- private void ultraGridOrderDeliry_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow ugr = ultraGridOrderDeliry.ActiveRow;
- if (ugr == null)
- {
- return;
- }
- String ordLnDlyPk = ugr.Cells["OrdLnDlyPk"].Value.ToString().Trim();
- DoQuerygTranSit(ordLnDlyPk);
- }
- private void InitCombo()
- {
- this.Controls.Add(uceA);
- this.Controls.Add(uceB);
- uceA.Visible = false;
- uceB.Visible = false;
- DataTable dtA = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderColligateInfomation.getBaseInfo2002", new object[] { }, this.ob);
- DataTable dtB = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderColligateInfomation.getBaseInfo2003", new object[] { }, this.ob);
- uceA.DataSource = dtA;
- uceA.DisplayMember = "BASENAME";
- uceA.ValueMember = "BASECODE";
- uceB.DataSource = dtB;
- uceB.DisplayMember = "BASENAME";
- uceB.ValueMember = "BASECODE";
- ultraGridOrderLine.DisplayLayout.Bands[0].Columns["CraftFileTypeCode"].EditorComponent = uceA;
- ultraGridOrderLine.DisplayLayout.Bands[0].Columns["CraftFileTypeCode"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- ultraGridOrderLine.DisplayLayout.Bands[0].Columns["CraftFileFlagCode"].EditorComponent = uceB;
- ultraGridOrderLine.DisplayLayout.Bands[0].Columns["CraftFileFlagCode"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
- ultraGridOrderLine.DisplayLayout.Bands[0].Columns["FilePath"].EditorComponent = askItemImg;
- }
- private void ultraGridOrderLine_CellChange(object sender, CellEventArgs e)
- {
- ultraGridOrderLine.UpdateData();
- if (ultraGridOrderLine.ActiveRow == null)
- {
- return;
- }
- if (e.Cell.Column.Key.Equals("CraftFileTypeCode"))
- {
- ultraGridOrderLine.ActiveRow.Cells["CraftFileTypeNm"].Value = e.Cell.Text;
- }
- if (e.Cell.Column.Key.Equals("CraftFileFlagCode"))
- {
- ultraGridOrderLine.ActiveRow.Cells["CraftFileFlagNm"].Value = e.Cell.Text;
- }
- if (e.Cell.Column.Key.Equals("CHC"))
- {
- if (Boolean.Parse(e.Cell.Value.ToString()))
- {
- e.Cell.Row.Cells["CraftFileTypeCode"].Activation = Activation.AllowEdit;
- e.Cell.Row.Cells["CraftFileFlagCode"].Activation = Activation.AllowEdit;
- e.Cell.Row.Cells["FilePath"].Activation = Activation.AllowEdit;
- e.Cell.Row.Cells["CraftFileMan"].Activation = Activation.AllowEdit;
- e.Cell.Row.Cells["CraftFileNo"].Activation = Activation.AllowEdit;
- }
- else
- {
- e.Cell.Row.Cells["CraftFileTypeCode"].Activation = Activation.ActivateOnly;
- e.Cell.Row.Cells["CraftFileFlagCode"].Activation = Activation.ActivateOnly;
- e.Cell.Row.Cells["FilePath"].Activation = Activation.ActivateOnly;
- e.Cell.Row.Cells["CraftFileMan"].Activation = Activation.ActivateOnly;
- e.Cell.Row.Cells["CraftFileNo"].Activation = Activation.ActivateOnly;
- }
- }
- }
- private void askItemImg_EditorButtonClick(object sender, EditorButtonEventArgs e)
- {
- UltraGridRow ugr = ultraGridOrderLine.ActiveRow;
- if (ugr == null)
- {
- return;
- }
- string ordLnPk = ugr.GetValue("OrdLnPk");
- string filePath = "saleOrder/ReviewForm/frmOrderColligateInfomation/" + ordLnPk;
- if (e.Button.Key.ToLower().Equals("select"))
- {
- dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePath);
- down.ShowDialog();
- }
- if (e.Button.Key.ToLower().Equals("choice"))
- {
- bool isUpload = FlileUploadcomm.FlileUpload(filePath);
- if (isUpload)
- {
- dlgOrderAskDown down = new dlgOrderAskDown(this.ob, filePath);
- down.ShowDialog();
- }
- }
- ugr.Cells["CraftFilePath"].Value = filePath;
- }
- /// <summary>
- /// 设置列只可读
- /// </summary>
- /// <param name="ugr">UltraGrid</param>
- /// <param name="columns">列数组</param>
- private void SetColumnReadOnly()
- {
- for (int i = 0; i < ultraGridOrderLine.Rows.Count; i++)
- {
- UltraGridRow ugr = ultraGridOrderLine.Rows[i];
- for (int j = 0; j < ugr.Cells.Count; j++)
- {
- if (!ugr.Cells[j].Column.Key.Equals("CHC"))
- ugr.Cells[j].Activation = Activation.ActivateOnly;
- }
- if (ugr.Cells["CraftFilePath"].Value.ToString().Length > 0)
- {
- ugr.Cells["FilePath"].Value = "已上传";
- }
- }
- }
- private void ultraComboEditorOrderNo_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar == 13)
- {
- DoQuery();
- }
- }
- private void DoLink()
- {
- UltraGridRow ugr = ultraGridOrderHead.ActiveRow;
- if (ugr == null)
- {
- MessageUtil.ShowWarning("请选择合同行");
- return;
- }
- String orderNo = ugr.Cells["OrderNo"].Text.Trim();
- //调用系统默认的浏览器
- //System.Diagnostics.Process.Start("http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepInterTrade.cpt&__bypagesize__=false" + "&cmbOrder=" + strOrder);
- FrmOrderRepExcel fBug = new FrmOrderRepExcel(this.ob, "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepInterTrade.cpt&__bypagesize__=false" + "&cmbOrder=" + orderNo);
- fBug.AutoSize = true;
- fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fBug.WindowState = FormWindowState.Maximized;
- fBug.Show();
- }
- /// <summary>
- /// 正式合同打印
- /// </summary>
- private void PrintOrder()
- {
- UltraGridRow ugr = ultraGridOrderHead.ActiveRow;
- if (ugr == null)
- {
- MessageUtil.ShowWarning("请选择您要打印的合同!");
- return;
- }
- string ordPk = ugr.Cells["ORDPK"].Value.ToString();
- string printPrice = ugr.Cells["PRINTPRICE"].Value.ToString();
- //生效以后的状态的合同才能打印
- DataTable stsDt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderColligateInfomation.queryOrderHeadStatus", new object[] { ordPk }, ob);
- if (stsDt == null && stsDt.Rows.Count == 0)
- {
- //价格评审通过或放行通过的合同才能打印
- MessageUtil.ShowWarning("价格评审通过或放行通过的合同才能打印!");
- return;
- }
- //if (printPrice.Trim() == "结算价")
- //{
- // DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderColligateInfomation.queryBlaPriceStatus", new object[] { ordPk }, ob);
- // if (dt != null && dt.Rows.Count > 0)
- // {
- // if (dt.Rows[0][0].ToString() != "0")
- // {
- // MessageUtil.ShowWarning("您选择合同的结算价尚未全部确认,不能打印!");
- // return;
- // }
- // }
- // else
- // {
- // return;
- // }
- //}
- string saleOrg = ugr.Cells["SaleOrg"].Value.ToString();
- string strurl = "";
- if (saleOrg == "100101")
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepFormalContractPrint.cpt&op=view" + "&ORD_PK=" + ordPk;
- else if (saleOrg == "100103")
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepFormalContractPrintGM.cpt&op=view" + "&ORD_PK=" + ordPk;
- if (strurl == "")
- {
- MessageUtil.ShowWarning("销售组织异常,无法打印!");
- return;
- }
- FrmOrderRepExcel fBug = new FrmOrderRepExcel(ob, strurl);
- fBug.AutoSize = true;
- fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fBug.WindowState = FormWindowState.Maximized;
- fBug.Text = "合同打印";
- fBug.Show();
- //写入打印时间和打印次数(不管有没有打印 打印是否成功)
- ServerHelper.SetData("com.steering.pss.sale.order.CoreOrderColligateInfomation.setPrintTimeAndCount", new object[] { ordPk }, this.ob);
- }
- /// <summary>
- /// 正式合同打印A4
- /// </summary>
- private void PrintOrderA4()
- {
- UltraGridRow ugr = ultraGridOrderHead.ActiveRow;
- if (ugr == null)
- {
- MessageUtil.ShowWarning("请选择您要打印的合同!");
- return;
- }
- string ordPk = ugr.Cells["ORDPK"].Value.ToString();
- string printPrice = ugr.Cells["PRINTPRICE"].Value.ToString();
- //生效以后的状态的合同才能打印
- DataTable stsDt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderColligateInfomation.queryOrderHeadStatus", new object[] { ordPk }, ob);
- if (stsDt == null && stsDt.Rows.Count == 0)
- {
- //价格评审通过或放行通过的合同才能打印
- MessageUtil.ShowWarning("价格评审通过或放行通过的合同才能打印!");
- return;
- }
-
- string saleOrg = ugr.Cells["SaleOrg"].Value.ToString();
- string strurl = "";
- if (saleOrg == "100101")
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepFormalContractPrintA4.cpt&op=view" + "&ORD_PK=" + ordPk;
- else if (saleOrg == "100103")
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepFormalContractPrintGMA4.cpt&op=view" + "&ORD_PK=" + ordPk;
- if (strurl == "")
- {
- MessageUtil.ShowWarning("销售组织异常,无法打印!");
- return;
- }
- FrmOrderRepExcel fBug = new FrmOrderRepExcel(ob, strurl);
- fBug.AutoSize = true;
- fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fBug.WindowState = FormWindowState.Maximized;
- fBug.Text = "合同打印";
- fBug.Show();
- //写入打印时间和打印次数(不管有没有打印 打印是否成功)
- ServerHelper.SetData("com.steering.pss.sale.order.CoreOrderColligateInfomation.setPrintTimeAndCount", new object[] { ordPk }, this.ob);
- }
- /// <summary>
- /// 合同背面打印
- /// </summary>
- private void PrintBackA4()
- {
- string strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepFormalContractPrintBackA4.cpt&op=view";
- FrmOrderRepExcel fBug = new FrmOrderRepExcel(ob, strurl);
- fBug.AutoSize = true;
- fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fBug.WindowState = FormWindowState.Maximized;
- fBug.Text = "合同背面打印";
- fBug.Show();
- }
- /// <summary>
- /// 正式合同打印预览
- /// </summary>
- private void PrintOrderPreview()
- {
- UltraGridRow ugr = ultraGridOrderHead.ActiveRow;
- if (ugr == null)
- {
- MessageUtil.ShowWarning("请选择您要打印的合同!");
- return;
- }
- string ordPk = ugr.Cells["ORDPK"].Value.ToString();
- string printPrice = ugr.Cells["PRINTPRICE"].Value.ToString();
- //打印预览 不需要条件限制
- //生效以后的状态的合同才能打印
- /*DataTable stsDt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderColligateInfomation.queryOrderHeadStatus", new object[] { ordPk }, ob);
- if (stsDt != null && stsDt.Rows.Count > 0)
- {
- //价格评审通过以后状态 允许打印
- }
- else
- {
- MessageUtil.ShowWarning("价格评审通过以后的合同才能打印!");
- return;
- }
- if (printPrice.Trim() == "结算价")
- {
- DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderColligateInfomation.queryBlaPriceStatus", new object[] { ordPk }, ob);
- if (dt != null && dt.Rows.Count > 0)
- {
- if (dt.Rows[0][0].ToString() != "0")
- {
- MessageUtil.ShowWarning("您选择合同的结算价尚未全部确认,不能打印!");
- return;
- }
- }
- else
- {
- return;
- }
- }*/
- string saleOrg = ugr.Cells["SaleOrg"].Value.ToString();
- string strurl = "";
- if (saleOrg == "100101")
- {
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepFormalContractPrintPreview.cpt&op=view" + "&ORD_PK=" + ordPk;
- // strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepMilMobileCard.cpt&op=view";
- }
- else if (saleOrg == "100103")
- strurl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepFormalContractPrintPreviewGM.cpt&op=view" + "&ORD_PK=" + ordPk;
- if (strurl == "")
- {
- MessageUtil.ShowWarning("销售组织异常,无法打印!");
- return;
- }
- FrmOrderRepExcel fBug = new FrmOrderRepExcel(ob, strurl);
- fBug.AutoSize = true;
- fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fBug.WindowState = FormWindowState.Maximized;
- fBug.Text = "合同打印预览";
- fBug.Show();
- }
- private void radioBal_CheckedChanged(object sender, EventArgs e)
- {
- this.Cursor = Cursors.WaitCursor;
- DoQuery();
- this.Cursor = Cursors.Default;
- }
- private void radioAll_CheckedChanged(object sender, EventArgs e)
- {
- this.Cursor = Cursors.WaitCursor;
- DoQuery();
- this.Cursor = Cursors.Default;
- }
- }
- }
|