Ejemplo n.º 1
0
        public Condition(int id)
        {
            m_ConditionId = id;

            F_CONDITION condition = DAL.WorkFlow.Condition.Get(m_ConditionId);

            m_Sql         = condition.Sql;
            m_ConditionId = condition.ID;
            m_Operator    = condition.Operator;
            m_Value       = condition.Value;
            m_Type        = condition.Type;
            m_Transation  = new Transation(condition.TransationID);
        }
Ejemplo n.º 2
0
        public static bool Save(F_CONDITION entity)
        {
            using (MainDataContext dbContext = new MainDataContext())
            {
                var model = dbContext.F_CONDITION.FirstOrDefault(t => t.ID == entity.ID);

                model.CreateTime   = entity.CreateTime;
                model.Sql          = entity.Sql;
                model.TransationID = entity.TransationID;
                model.Operator     = entity.Operator;
                model.Type         = entity.Type;
                model.Value        = entity.Value;

                dbContext.SubmitChanges();
            }

            return(true);
        }
Ejemplo n.º 3
0
        public static int Insert(F_CONDITION entity)
        {
            using (MainDataContext dbContext = new MainDataContext())
            {
                var list = from a in dbContext.F_CONDITION select a.ID;

                long total = list.LongCount();

                if (total == 0)
                {
                    entity.ID = 1;
                }
                else
                {
                    entity.ID = dbContext.F_CONDITION.Max(a => a.ID) + 1;
                }

                dbContext.F_CONDITION.InsertOnSubmit(entity);

                dbContext.SubmitChanges();

                return(entity.ID);
            }
        }