Ejemplo n.º 1
0
 /// <summary>
 /// 还原 for setting   added by liuxzha 2015.04.10
 /// </summary>
 /// <param name="id"></param>
 public void DoRecover(string id)
 {
     DAL.TaskLog.ITaskLogMain logdal = ClassFactory.GetITaskLogMainDAL(3);
     Model.Synergismlog       log    = logdal.GetModel(id);
     log.Cstatus = Constant.SynerginsLog_Cstatus_NoDeal;
     log.Endtime = DateTime.Now;
     logdal.Update(log);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 还原 for setting   added by liuxzha 2015.04.10
        /// </summary>
        /// <param name="id"></param>
        public void DoRecover(int taskType, string id, string vouchertype)
        {
            DAL.TaskLog.ITaskLogMain logdal = ClassFactory.GetITaskLogMainDAL(taskType);
            BaseOp tmpOp = ClassFactory.GetBaseOp(vouchertype, taskType);

            Model.Synergismlog log = logdal.GetModel(id, tmpOp);
            log.Cstatus = Constant.SynerginsLog_Cstatus_NoDeal;
            log.Endtime = DateTime.Now;
            logdal.Update(log, tmpOp);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 更新协同路线字段
 /// </summary>
 /// <param name="bd"></param>
 /// <param name="dr"></param>
 protected void UpdateTeamworkField(BaseData bd, Model.DealResult dr)
 {
     if (bd.TaskType == 1)
     {
         DAL.TaskLog.ITaskLogMain logdal   = ClassFactory.GetITaskLogMainDAL(3);
         Model.Synergismlog       logmdoel = logdal.GetModel(bd.Synergismlogdt.Id);
         string tablename = SetTableName() + "_extradefine";
         DAL.Common.UpdateTeamworkField(logmdoel.Croutetype, tablename, dr.VouchIdRet, bd.ConnectInfo.Constring);
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 重做
        /// </summary>
        /// <param name="autoid"></param>
        /// <param name="id"></param>
        public void ReDo(string autoid, string id)
        {
            DAL.TaskLog.ITaskLogDetail dal = ClassFactory.GetITaskLogDetailDAL(3);
            Model.Synergismlogdt       dt  = dal.GetModel(autoid);
            dt.Cstatus    = Constant.SynergisnLogDT_Cstatus_NoDeal;
            dt.Cerrordesc = string.Empty;

            //如果有单号,先删除再重发
            if (string.IsNullOrEmpty(dt.Cvoucherno))
            {
                DeleteSyncDt(1, autoid, id);
            }

            dal.Update(dt);
            DAL.TaskLog.ITaskLogMain logdal = ClassFactory.GetITaskLogMainDAL(3);
            Model.Synergismlog       log    = logdal.GetModel(id);
            log.Cstatus = Constant.SynerginsLog_Cstatus_Dealing;
            logdal.Update(log);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 删除
        /// added by liuxzha 2016.03.08
        /// </summary>
        /// <param name="taskType">任务类别 0 CQ 1 XT</param>
        /// <param name="autoid"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public DealResult DeleteVouch(int tasktype, Synergismlogdt dt)
        {
            DealResult dr = new DealResult();

            try
            {
                DAL.TaskLog.ITaskLogDetail daldt    = ClassFactory.GetITaskLogDetailDAL(tasktype);
                BLL.TaskLog.ITaskLogDetail logdtbll = ClassFactory.GetITaskLogDetailBLL(tasktype);


                #region 协同 校验
                if (tasktype.Equals("1"))
                {
                    List <Model.Synergismlogdt> nextlist = logdtbll.GetNext(dt, null);

                    foreach (Model.Synergismlogdt next in nextlist)
                    {
                        if (!string.IsNullOrEmpty(next.Cvoucherno))
                        {
                            dr.ResultNum = -1;
                            dr.ResultMsg = "下游单据未删除,请先删除下游单据";
                            return(dr);
                        }
                    }
                }
                #endregion

                BaseData bd = ClassFactory.GetBaseData(dt);
                bd.Dodelete            = true;
                bd.Synergismlogdt      = dt;
                bd.Fristsynergismlogdt = daldt.GetFirst(dt);
                BaseOp op = ClassFactory.GetBaseOp(dt);
                op.MakeData(dt, bd);

                string vouchid = op.GetCodeorID(dt.Cvoucherno, bd, "id");

                if (!string.IsNullOrEmpty(vouchid))
                {
                    dr = op.UndoMake(bd, dt);
                }

                if (dr.ResultNum < Constant.ResultNum_NoError)
                {
                    return(dr);
                }
                dt.Cstatus    = Constant.SynergisnLogDT_Cstatus_Delete;
                dt.Cvoucherno = string.Empty;
                daldt.Update(dt);
                DAL.TaskLog.ITaskLogMain logdal = ClassFactory.GetITaskLogMainDAL(tasktype);


                Model.Synergismlog log = logdal.GetModel(dt.Id, dt.OP);
                log.Cstatus = Constant.SynerginsLog_Cstatus_Wait;
                logdal.Update(log, dt.OP);
            }
            catch (Exception ex)
            {
                dr.ResultMsg = ex.ToString();
                dr.ResultNum = -1;
            }
            return(dr);
        }