Exemple #1
0
 public BO.Result MoveStatus(string p41code, string b02code)
 {
     BO.b02Status c = _mother.b02StatusBL.LoadByCode(b02code);
     if (c == null)
     {
         return(new BO.Result(true, "Status s tímto kódem nelze načíst."));
     }
     BO.p41Task rec = LoadByCode(p41code, 0);
     if (rec == null)
     {
         return(new BO.Result(true, "Zakázka s tímto kódem nelze načíst."));
     }
     if (_db.RunSql("UPDATE p41Task set b02ID=@b02id WHERE p41ID=@pid", new { b02id = c.pid, pid = rec.pid }))
     {
         return(new BO.Result(false, "Status nahozen."));
     }
     else
     {
         return(new BO.Result(true, "Chyba"));
     }
 }
Exemple #2
0
        public int Save(BO.b02Status rec)
        {
            var p = new DL.Params4Dapper();

            p.AddInt("pid", rec.b02ID);
            p.AddString("b02Name", rec.b02Name);
            p.AddString("b02Code", rec.b02Code);
            p.AddString("b02Entity", rec.b02Entity);
            p.AddInt("b02Ordinary", rec.b02Ordinary);
            p.AddString("b02Memo", rec.b02Memo);
            p.AddEnumInt("b02StartFlag", rec.b02StartFlag);
            p.AddEnumInt("b02MoveFlag", rec.b02MoveFlag);
            p.AddString("b02MoveBySql", rec.b02MoveBySql);
            p.AddString("b02Color", rec.b02Color);

            int intPID = _db.SaveRecord("b02Status", p.getDynamicDapperPars(), rec);

            if (rec.b02StartFlag == BO.b02StartFlagENUM.DefaultStatus)
            {
                _db.RunSql("UPDATE b02Status SET b02StartFlag=0 WHERE b02Entity LIKE @entity AND b02ID<>@pid", new { entity = rec.b02Entity, pid = intPID });
            }
            return(intPID);
        }