| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using CoreFS.CA06;
- namespace Core.StlMes.Client.GlBusiness
- {
- public partial class freightManage : FrmBase
- {
- public freightManage()
- {
- InitializeComponent();
- }
- private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- switch (e.Tool.Key)
- {
- case "Query":
- doQuery();
- break;
- case "doConfirm":
- doConfirm();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- private string setCreateTimeStart(Object value)
- {
- DateTime time = Convert.ToDateTime(value);
- DateTime endtime = new DateTime(time.Year, time.Month, time.Day, 0, 0, 0);
- endtime.ToLongTimeString();
- return endtime.ToString();
- }
- private string setCreateTimeEnd(Object value)
- {
- DateTime time = Convert.ToDateTime(value);
- DateTime endtime = new DateTime(time.Year, time.Month, time.Day, 23, 59, 59);
- return endtime.ToString();
- }
- /// <summary>
- /// 查询
- /// </summary>
- public void doQuery()
- {
- this.dataTable1.Clear();
- ArrayList parm = new ArrayList();
- parm.Add(txt_orderNo.Text.Trim());
- if (QcreateTime_Begin.Value != null)//创建开始时间
- {
- parm.Add(setCreateTimeStart(QcreateTime_Begin.Value));
- }
- if (QcreateTime_End.Value != null)//创建结束时间
- {
- parm.Add(setCreateTimeEnd(QcreateTime_End.Value));
- }
- DataTable dt = ServerHelper.GetData("com.steering.pss.glbusiness.SlmGlAccrued.doQueryFreight", new Object[] { parm }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true);
- }
- /// <summary>
- /// 增加运费
- /// </summary>
- public void doConfirm()
- {
- try
- {
- this.ultraGrid1.UpdateData();
- if (ultraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowTips("请选择需要增加的数据!");
- return;
- }
- if (ultraGrid1.ActiveRow.Cells["COST_TPYE_DESC"].Value.ToString() == "运费")
- {
- MessageUtil.ShowTips("请选择货款数据新增运费!");
- return;
- }
- if (ultraGrid1.ActiveRow.Cells["BALNCE_TOL_PRICE"].Text == "")
- {
- MessageUtil.ShowTips("新增数据运费不能为空!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确定添加?") == DialogResult.No)
- {
- return;
- }
-
- ArrayList all = new ArrayList();
- all.Add("BLyyyyMMdd00001");//结算单号
- all.Add(ultraGrid1.ActiveRow.Cells["ORDER_NO"].Value.ToString());//客户合同号
- if (ultraGrid1.ActiveRow.Cells["TRADE_TYPE"].Value.ToString().Equals("122301"))
- {
- all.Add("123401");//结算类型编码
- all.Add("应收");//结算类型
- }
- else if (ultraGrid1.ActiveRow.Cells["TRADE_TYPE"].Value.ToString().Equals("122302"))
- {
- all.Add("123402");//结算类型编码
- all.Add("应付");//结算类型
- }
- all.Add("123302");//费用类型编码
- all.Add("运费");//费用类型
- all.Add(ultraGrid1.ActiveRow.Cells["CUSTOMER_NO"].Value.ToString());
- all.Add(ultraGrid1.ActiveRow.Cells["CUSTOMER_NM"].Value.ToString());
- all.Add(ultraGrid1.ActiveRow.Cells["SUPPLY_UNIT"].Value.ToString());
- all.Add(ultraGrid1.ActiveRow.Cells["STLMT_UNIT_NO"].Value.ToString());
- all.Add(ultraGrid1.ActiveRow.Cells["STLMT_UNIT_NM"].Value.ToString());
- all.Add("0");//支付状态
- all.Add("1");//数据状态
- all.Add(UserInfo.GetUserName());
- all.Add(UserInfo.GetDepartment());
- all.Add(ultraGrid1.ActiveRow.Cells["BALNCE_TOL_PRICE"].Value.ToString());
- all.Add(ultraGrid1.ActiveRow.Cells["CG_ORDER_NO"].Value.ToString());
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.glbusiness.SlmGlAccrued";
- ccp.MethodName = "doAddFreight";
- ccp.ServerParams = new object[] { all };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode == -1) return;
- MessageBox.Show("增加成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.Close();
- }
- catch (System.Exception ex)
- {
- MessageUtil.ShowTips("操作失败:" + ex.Message);
- }
- }
- private void FrmSlmGlPay_Load(object sender, EventArgs e)
- {
- QcreateTime_Begin.Value = DateTime.Now.AddMonths(-1);
- QcreateTime_End.Value = DateTime.Now;
- GridHelper.SetColumnsActivateAndColor(ultraGrid1.Rows.Band, "BALNCE_TOL_PRICE");
- }
-
- }
- }
|