public override Synergismlogdt GetFirst(Synergismlogdt dt) { Model.Synergismlogdt fdt = new Model.Synergismlogdt(); fdt.Cvouchertype = "MO21"; fdt.Id = dt.Id; fdt.Ilineno = 1; DataSet ds = DbHelperSQL.Query("SELECT MoCode FROM " + bodytable + " with(nolock) WHERE ID = " + dt.Id); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { fdt.Cvoucherno = ds.Tables[0].Rows[i]["MoCode"].ToString(); fdt.Autoid = dt.Id; } return(fdt); }
public override Synergismlogdt GetFirst(Synergismlogdt dt) { Model.Synergismlogdt fdt = new Model.Synergismlogdt(); fdt.Cvouchertype = sourceCardNo; fdt.Id = dt.Id; fdt.Ilineno = 1; DataSet ds = DbHelperSQL.Query("SELECT MoCode FROM " + bodytable + " with(nolock) WHERE ID = " + U8.Interface.Bus.Comm.Convert.ConvertDbValueFromPro(dt.Id, "string")); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { fdt.Cvoucherno = ds.Tables[0].Rows[i]["MoCode"].ToString(); fdt.Autoid = dt.Id; } return(fdt); }
public override Synergismlogdt GetFirst(Synergismlogdt dt) { string sourceCodeColName = ""; Model.Synergismlogdt fdt = new Model.Synergismlogdt(); fdt.Cvouchertype = sourceCardNo; fdt.Id = dt.Id; fdt.Ilineno = 1; fdt.Autoid = dt.Id; //DataSet ds = DbHelperSQL.Query("SELECT " + sourceCodeColName + " FROM " + bodytable + " with(nolock) WHERE ID = " + dt.Id); //for (int i = 0; i < ds.Tables[0].Rows.Count; i++) //{ //fdt.Cvoucherno = ds.Tables[0].Rows[i][sourceCodeColName].ToString(); //} return(fdt); }
/// <summary> /// 得到一个对象实体 /// </summary> /// <param name="autoid">子任务ID</param> /// <returns></returns> public override Model.Synergismlogdt GetModel(string autoid) { Model.Synergismlogdt tmpd = new Synergismlogdt(); tmpd.Autoid = autoid; tmpd.Id = autoid; tmpd.Cvouchertype = cardNo; tmpd.Ilineno = 2; tmpd.Cstatus = U8.Interface.Bus.ApiService.DAL.Constant.SynerginsLog_Cstatus_NoDeal; DataSet ds = DbHelperSQL.Query("SELECT t.cRdCode,t.id,t.opertype FROM " + headtable + " t with(nolock) WHERE t.id = " + U8.Interface.Bus.Comm.Convert.ConvertDbValueFromPro(autoid, "string")); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { tmpd.Cvoucherno = ds.Tables[0].Rows[i]["cRdCode"].ToString(); tmpd.Autoid = ds.Tables[0].Rows[i]["id"].ToString(); // int.Parse(ds.Tables[0].Rows[i]["id"].ToString()); tmpd.Id = ds.Tables[0].Rows[i]["id"].ToString(); tmpd.Cdealmothed = int.Parse(ds.Tables[0].Rows[i]["opertype"].ToString()) + 1; // 0(自动生单/自动审核) 1增 2修改 3删 } return(tmpd); }
/// <summary> /// 得到一个对象实体 /// </summary> /// <param name="autoid">子任务ID</param> /// <returns></returns> public override Model.Synergismlogdt GetModel(string autoid) { Model.Synergismlogdt tmpd = new Synergismlogdt(); tmpd.Autoid = autoid.ToString(); tmpd.Id = autoid.ToString(); tmpd.Cvouchertype = cardNo; tmpd.Ilineno = 2; tmpd.Cstatus = U8.Interface.Bus.ApiService.DAL.Constant.SynerginsLog_Cstatus_NoDeal; //DataSet ds = DbHelperSQL.Query("SELECT b.cRdCode,b.id,b.did,t.opertype FROM " + bodytable + " b with(nolock) left join " + headtable + " t with(nolock) on b.id = t.id WHERE b.DID = " + autoid); DataSet ds = DbHelperSQL.Query("SELECT t." + voucherNoColumnName + ",t.id,t.opertype FROM " + headtable + " t with(nolock) WHERE t.id = " + autoid); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { tmpd.Cvoucherno = ds.Tables[0].Rows[i][voucherNoColumnName].ToString(); tmpd.Autoid = ds.Tables[0].Rows[i]["id"].ToString(); //int.Parse(ds.Tables[0].Rows[i]["id"].ToString()); tmpd.Id = ds.Tables[0].Rows[i]["id"].ToString(); //int.Parse(ds.Tables[0].Rows[i]["id"].ToString()); tmpd.Cdealmothed = int.Parse(ds.Tables[0].Rows[i]["opertype"].ToString()) + 1; // 0(自动生单/自动审核) 1增 2修改 3删 } return(tmpd); }
/// <summary> /// 得到一个对象实体 /// </summary> /// <param name="autoid">子任务ID</param> /// <returns></returns> public static Model.Synergismlogdt GetModel(int tasktype, string headtable, string cvouchertype, string vouchernocolname, string opertypecolname, string autoid) { Model.Synergismlogdt tmpd = new Synergismlogdt(); tmpd.Autoid = autoid; tmpd.Id = autoid; tmpd.Cvouchertype = cvouchertype; tmpd.Ilineno = 2; tmpd.TaskType = tasktype; tmpd.Cstatus = U8.Interface.Bus.ApiService.DAL.Constant.SynerginsLog_Cstatus_NoDeal; DataSet ds = DbHelperSQL.Query("SELECT t." + vouchernocolname + ",t.id,t." + opertypecolname + " FROM " + headtable + " t with(nolock) WHERE t.id = " + U8.Interface.Bus.Comm.Convert.ConvertDbValueFromPro(autoid, "string")); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { tmpd.Cvoucherno = ds.Tables[0].Rows[i][vouchernocolname].ToString(); tmpd.Autoid = ds.Tables[0].Rows[i]["id"].ToString(); // int.Parse(ds.Tables[0].Rows[i]["id"].ToString()); tmpd.Id = ds.Tables[0].Rows[i]["id"].ToString(); // int.Parse(ds.Tables[0].Rows[i]["id"].ToString()); tmpd.Cdealmothed = int.Parse(ds.Tables[0].Rows[i][opertypecolname].ToString()) + 1; // 0(自动生单/自动审核) 1增 2修改 3删 } return(tmpd); }
public override Synergismlogdt GetFirst(Synergismlogdt dt) { throw new NotImplementedException(); }
/// <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.TaskLogFactory.ITaskLogDetail daldt = ClassFactory.GetITaskLogDetailDAL(tasktype); BLL.SynergisnLogDT logdtbll = new SynergisnLogDT(); #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.TaskLogFactory.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); }