/// <summary> /// init info /// </summary> void InitInfo() { if (string.IsNullOrEmpty(EditId)) { Utils.RCWE_AJAX("0", "异常请求"); } var info = new EyouSoft.BLL.BDingDan().GetInfo(EditId); if (info == null) { Utils.RCWE_AJAX("0", "异常请求"); } var cgdInfo = new EyouSoft.BLL.BCaiGouDan().GetInfo(info.CaiGouDanId); if (cgdInfo == null) { Utils.RCWE_AJAX("0", "异常请求"); } ltrCaiGouDanHao.Text = info.CaiGouDanHao; ltrCaiGouDanName.Text = info.CaiGouDanName; ltrCaiGouRenName.Text = cgdInfo.CaoZuoRenName; ltrCaiGouBuMenName.Text = info.CaiGouBuMen; ltrGysName.Text = info.GysName; ltrStatus.Text = info.Status.ToString(); DingDanStatus = info.Status; if (info.ChanPins != null && info.ChanPins.Count > 0) { rpt.DataSource = info.ChanPins; rpt.DataBind(); } ltrHeJiJinE.Text = info.JinE.ToString("F2"); ltrYaoQiuDaoHuoTime.Text = string.Format("{0:yyyy-MM-dd}", cgdInfo.YaoQiuDaoHuoTime); ltrShouHuoRenName.Text = cgdInfo.ShouHuoRenName; ltrShouHuoRenDianHua.Text = cgdInfo.ShouHuoRenDianHua; ltrShouHuoDiZhi.Text = cgdInfo.ShouHuoDiZhi; if (info.Status == EyouSoft.Model.DingDanStatus.供应商发货完成 || info.Status == EyouSoft.Model.DingDanStatus.采购商确认收货) { IsXianShiShiJiDaoHuoShuLiang = true; phFaHuo.Visible = true; phDaoHuo.Visible = true; ltrFaHuoTime.Text = string.Format("{0:yyyy-MM-dd}", info.SongHuoTime); ltrYuJiDaoHuoTime.Text = string.Format("{0:yyyy-MM-dd}", info.YuJiDaoHuoTime); ltrSongHuoRenName.Text = info.SongHuoRenName; ltrSongHuoRenDianHua.Text = info.SongHuoRenDianHua; ltrGysFaHuoShuoMing.Text = info.GysFaHuoShuoMing; txtShiJiDaoHuoTime.Value = DateTime.Now.ToString("yyyy-MM-dd"); txtDaoHuoQueRenRenName.Value = YongHuInfo.Name; } if (info.Status == EyouSoft.Model.DingDanStatus.采购商确认收货) { phDaoHuo.Visible = true; txtShiJiDaoHuoTime.Value = string.Format("{0:yyyy-MM-dd}", info.DaoHuoTime); txtDaoHuoQueRenRenName.Value = info.CgsShouHuoRen; IsReadonlyDaoHuoShuLiang = "1"; } var _caoZuo = string.Empty; var _quXiao = "<a href=\"javascript:void(0)\" class=\"blue_btn\" id=\"a_quxiao\">取消采购</a> "; var _queRenBaoJiao = "<a href=\"javascript:void(0)\" class=\"blue_btn\" id=\"a_querenbaojia\">确认报价</a> "; var _queRenShouHuo = "<a href=\"javascript:void(0)\" class=\"blue_btn\" id=\"a_querenshouhuo\">确认收货</a> "; switch (info.Status) { case EyouSoft.Model.DingDanStatus.采购申请: _caoZuo = _quXiao; break; case EyouSoft.Model.DingDanStatus.供应商完成报价: _caoZuo = _queRenBaoJiao + _quXiao; break; case EyouSoft.Model.DingDanStatus.采购商确认报价: _caoZuo = _quXiao; break; case EyouSoft.Model.DingDanStatus.供应商发货完成: _caoZuo = _queRenShouHuo; break; case EyouSoft.Model.DingDanStatus.采购商确认收货: _caoZuo = "已确认收货,交易完成"; break; case EyouSoft.Model.DingDanStatus.取消采购: _caoZuo = "该采购订单已取消"; break; } if (info.CgsFuKuanStatus == EyouSoft.Model.FuKuanStatus.已付款) { phFuKuan.Visible = true; ltrFuKuanTime.Text = string.Format("{0:yyyy-MM-dd HH:mm}", info.CgsFuKuanTime); ltrFuKuanCaoZuoRenName.Text = info.CgsFuKuanCaoZuoRenName; } ltrCaoZuo.Text = _caoZuo; }
/// <summary> /// 设置订单状态,返回1成功,其它失败 /// </summary> /// <param name="dingDanId">订单编号</param> /// <param name="status">订单状态</param> /// <param name="caoZuoRenId">操作人编号</param> /// <returns></returns> public int SheZhiStatus(string dingDanId, EyouSoft.Model.DingDanStatus status, string caoZuoRenId) { if (string.IsNullOrEmpty(dingDanId) || string.IsNullOrEmpty(caoZuoRenId)) { return(0); } var info = GetInfo(dingDanId); if (info == null) { return(-1); } if (info.Status == EyouSoft.Model.DingDanStatus.计划采购) { return(-2); } var buKeQuXiaoStatus = new[] { EyouSoft.Model.DingDanStatus.供应商发货完成, EyouSoft.Model.DingDanStatus.采购商确认收货 }; if (status == EyouSoft.Model.DingDanStatus.取消采购 && buKeQuXiaoStatus.Contains(info.Status)) { return(-3); } int dalRetCode = dal.SheZhiStatus(dingDanId, status, caoZuoRenId, DateTime.Now); #region 消息处理 if (dalRetCode == 1) { var xiaoXiInfo = new EyouSoft.Model.MXiaoXiInfo(); xiaoXiInfo.BiaoTi = string.Empty; xiaoXiInfo.ChuLiRenId = string.Empty; xiaoXiInfo.ChuLiTime = null; xiaoXiInfo.FaChuGongSiId = string.Empty; xiaoXiInfo.FaChuRenId = caoZuoRenId; xiaoXiInfo.FaChuTime = DateTime.Now; xiaoXiInfo.GuanLianId = dingDanId; xiaoXiInfo.JieShouGongSiId = string.Empty; xiaoXiInfo.JieShouRenId = string.Empty; xiaoXiInfo.LeiXing = EyouSoft.Model.XiaoXiLeiXing.None; xiaoXiInfo.NeiRong = string.Empty; xiaoXiInfo.Status = EyouSoft.Model.XiaoXiStatus.未读; xiaoXiInfo.XiaoXiId = string.Empty; if (status == EyouSoft.Model.DingDanStatus.供应商完成报价) { xiaoXiInfo.BiaoTi = "待确认报价"; xiaoXiInfo.FaChuGongSiId = info.GysId; xiaoXiInfo.JieShouGongSiId = info.CgsId; xiaoXiInfo.LeiXing = EyouSoft.Model.XiaoXiLeiXing.采购商待确认报价; xiaoXiInfo.NeiRong = "您有一个采购单报价信息需要确认,采购单号:" + info.CaiGouDanHao + "。"; } if (status == EyouSoft.Model.DingDanStatus.采购商确认报价) { xiaoXiInfo.BiaoTi = "待发货"; xiaoXiInfo.FaChuGongSiId = info.CgsId; xiaoXiInfo.JieShouGongSiId = info.GysId; xiaoXiInfo.LeiXing = EyouSoft.Model.XiaoXiLeiXing.供应商待发货; xiaoXiInfo.NeiRong = "您有一个采购单需要发货,采购单号:" + info.CaiGouDanHao + "。"; } if (status == EyouSoft.Model.DingDanStatus.供应商发货完成) { xiaoXiInfo.BiaoTi = "待收货"; xiaoXiInfo.FaChuGongSiId = info.GysId; xiaoXiInfo.JieShouGongSiId = info.CgsId; xiaoXiInfo.LeiXing = EyouSoft.Model.XiaoXiLeiXing.采购商待确认收货; xiaoXiInfo.NeiRong = "您有一个采购单供应商已发货,待收货确认,采购单号:" + info.CaiGouDanHao + "。"; } BXiaoXi.XiaoXi_C(xiaoXiInfo); } #endregion if (dalRetCode == 1) { var logInfo = new EyouSoft.Model.MCaoZuoLogInfo(); logInfo.BiaoTi = "设置订单状态"; logInfo.NeiRong = "设置订单状态,订单编号:" + info.DingDanId + ",订单状态:" + status + "。"; logInfo.GuanLianId = info.DingDanId; BCaoZuoLog.Log_C(logInfo); } return(dalRetCode); }