Beispiel #1
0
        public void DeleteMeaningAndRelation(Meanings meaning)
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic.Add("@MeaningId", meaning.Id);
            processor.ExecuteNonQuery("DELETE FROM UserMeanRelation WHERE MeaningId=@MeaningId", dic);
            processor.ExecuteNonQuery("DELETE FROM Meanings WHERE ID=@MeaningId", dic);
        }
Beispiel #2
0
        public bool InsertOrUpdateMeaning(Dictionary <string, object> dic, DbTransaction tran)
        {
            string   desc = (string)dic["Desc"];
            Meanings m    = GetMeaningByName(desc);

            if (m == null || m.Id == 0)
            {
                return(this.InsertMeaning(dic, tran));
            }
            return(true);
        }
Beispiel #3
0
        public void InsertOrUpdateMeaning(Meanings meaning)
        {
            Meanings MeaningGotFromDbById = this.GetMeaningById(meaning.Id);

            if (MeaningGotFromDbById.Id != 0)
            {
                processor.Update <Meanings>(meaning, null);
            }
            else
            {
                processor.Insert <Meanings>(meaning, null);
            }
        }
Beispiel #4
0
        public bool InsertMeaning(Dictionary <string, object> dic, DbTransaction tran)
        {
            Meanings m = new Meanings();

            if (dic.Keys.Contains("ID"))
            {
                m.Id = (int)dic.First(p => { return(p.Key == "ID"); }).Value;
            }
            else
            {
                int id = this.GetMeaningPKValue();
                m.Id = id + 1;
            }
            m.Desc   = (string)dic.First(p => { return(p.Key == "Desc"); }).Value;
            m.Remark = (string)dic.First(p => { return(p.Key == "Remark"); }).Value;
            return(processor.Insert <Meanings>(m, tran));
        }
Beispiel #5
0
 public bool InsertMeaning(Meanings m, DbTransaction tran)
 {
     return(processor.Insert <Meanings>(m, tran));
 }
Beispiel #6
0
 public bool InsertMeaning(Meanings m)
 {
     return(InsertMeaning(m, null));
 }