| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Data;
- using System.Collections;
- using System.ComponentModel;
- using System.Drawing;
- using System.Windows.Forms;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinGrid;
- using ColumnDefine = Core.StlMes.Client.Sale.Common.TbColumnDefine.TbColumnDefine;
- namespace Core.StlMes.Client.Sale.BLL.SaleBusinessMgt.Plan
- {
- public class SlmShipNoApplyResultInputBll : SaleBusinessMgt.BllBase.BaseBll
- {
- public SlmShipNoApplyResultInputBll(OpeBase ob)
- : base(ob)
- {
- }
- /// <summary>
- /// 查询合同行入口
- /// </summary>
- /// <param name="sqlCondition"></param>
- /// <returns></returns>
- private DataSet GetShipNoApplyResultInputInfo(string sqlCondition)
- {
- string sqlStr = string.Format(SqlCollection.Plan.QUERY_SHIPNOAPPLYRINPUT, sqlCondition , base.DateTimeTocharFormat);
- return base.ExecuteQuery(sqlStr);
- }
- public DataSet GetValidShipNoApplyResultInput()
- {
- string sqlCondition = " and validflag = '1' ";
- return GetShipNoApplyResultInputInfo(sqlCondition);
- }
- public DataSet GetValidShipNoApplyResultInputByTransmonth(DateTime transmonth)
- {
- string sqlCondition = " and transmonth = " + Util.ConverObject.ConvertDateTimeValueToDbLanguage(transmonth) + " and validflag = '1'";
- return GetShipNoApplyResultInputInfo(sqlCondition);
- }
-
- public void Insert(Hashtable hs,out string errMsg)
- {
- errMsg = "";
- hs.Add(ColumnDefine.SLM_DLIV_SHIPAPPLY_RESULT.TRANSPORT_NUM, GetdlivShipApplyResultInfoCode());
- CoreClientParam param = base.GetCoreClientParam(_ServerName, "insert", new object[] { hs });
- CoreClientParam result = base.fr.ExecuteNonQuery(param, CoreInvokeType.Internal);
- errMsg = base.GetReturnErrorInfo(result);
- }
- public void Update(Hashtable hs, out string errMsg)
- {
- errMsg = "";
- CoreClientParam param = base.GetCoreClientParam(_ServerName, "update", new object[] { hs });
- CoreClientParam result = base.fr.ExecuteNonQuery(param, CoreInvokeType.Internal);
- errMsg = base.GetReturnErrorInfo(result);
- }
- public void Delete(ArrayList list, out string errMsg)
- {
- errMsg = "";
- CoreClientParam param = base.GetCoreClientParam(_ServerName, "delete", new object[] { list });
- CoreClientParam result = base.fr.ExecuteNonQuery(param, CoreInvokeType.Internal);
- errMsg = base.GetReturnErrorInfo(result);
- }
- /// <summary>
- /// 获取数据行数
- /// </summary>
- /// <returns></returns>
- private double GetdlivShipApplyResultInfoCount()
- {
- string sqlStr = "select count(1) from slm_dliv_shipapply_result ";
- DataSet ds = base.ExecuteQuery(sqlStr);
- if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
- return 0;
- return Util.ConverObject.ConvertToDouble(ds.Tables[0].Rows[0][0]);
- }
- /// <summary>
- /// 自动生成客户编码
- /// </summary>
- /// <returns></returns>
- private string GetdlivShipApplyResultInfoCode()
- {
- string transport_num = "";
- string sqlStr = @"select *
- from (select lpad(l || '', 6, 0) customberno, a.transport_num, rownum rn
- from (select level - 1 l from dual connect by level < {0}) b
- left join slm_dliv_shipapply_result a on a.transport_num =
- lpad(b.l || '', 6, 0)
- where a.transport_num is null
- order by b.l)
- where rn = 1";
- sqlStr = string.Format(sqlStr, GetdlivShipApplyResultInfoCount() + 100);
- DataSet ds = base.ExecuteQuery(sqlStr);
- try
- {
- if (ds.Tables[0].Rows.Count == 0)
- transport_num = "000001";
- else
- transport_num = ds.Tables[0].Rows[0]["CUSTOMBERNO"].ToString();
- }
- catch
- {
- }
- return transport_num;
- }
- private string _ServerName = "core.stlmes.server.sale.service.plan.SlmShipNoApplyResultInput";
- }
- }
|