Ejemplo n.º 1
0
 public static void Delete(Sys sys)
 {
     string sql = "select Id from tblLanguage order by id";
     StringBuilder sqlDel = new StringBuilder();
     using (SqlDataReader sdr = SqlHelper.ExecuteReader(SqlHelper.ConnectionString, CommandType.Text, sql))
     {
         while (sdr.Read())
         {
             sqlDel.Append(" delete LSys" + sdr[0].ToString() + "  where name='" + sys.Name + "'");
         }
         SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionString, CommandType.Text, sqlDel.ToString());
     }
 }
Ejemplo n.º 2
0
 public static Sys GetSys(string name, int language)
 {
     string sql = "select * from LSys"+language.ToString()+" where name ='"+name.ToString()+"'";
     Sys sys = null;
     using (SqlDataReader sdr = SqlHelper.ExecuteReader(SqlHelper.ConnectionString, CommandType.Text, sql))
     {
         if (sdr.Read())
         {
             sys = new Sys();
             sys.Name = (string)sdr["name"];
             sys.Value = (string)sdr["Value"];
             sys.Language = language;
         }
     }
     return sys;
 }
Ejemplo n.º 3
0
 public static IList<Sys> GetAll(int language)
 {
     string sql = "select * from LSys" + language.ToString() + " order by name";
     IList<Sys> syss = new List<Sys>();
     using (SqlDataReader sdr = SqlHelper.ExecuteReader(SqlHelper.ConnectionString, CommandType.Text, sql))
     {
         while (sdr.Read())
         {
             Sys sys = new Sys();
             sys.Name = (string)sdr["name"];
             sys.Value = (string)sdr["Value"];
             sys.Language = language;
             syss.Add(sys);
         }
     }
     return syss;
 }
Ejemplo n.º 4
0
 public static void Add(Sys sys)
 {
     string sql = "select Id from tblLanguage order by id";
     StringBuilder sqlAdd = new StringBuilder();
     StringBuilder sqlDel = new StringBuilder();
     using (SqlDataReader sdr = SqlHelper.ExecuteReader(SqlHelper.ConnectionString, CommandType.Text, sql))
     {
         while (sdr.Read())
         {
             if (sdr[0].ToString() == sys.Language.ToString())
                 sqlAdd.Append(" insert into LSys" + sdr[0].ToString() + " (name,value) VALUES('" + sys.Name + "','" + sys.Value + "') ");
             else
                 sqlAdd.Append(" insert into LSys" + sdr[0].ToString() + " (name,value) VALUES('" + sys.Name + "','') ");
             sqlDel.Append(" delete LSys" + sdr[0].ToString() + " where name='" + sys.Name + "");
         }
         SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionString, CommandType.Text, sqlAdd.ToString());
     }
 }
Ejemplo n.º 5
0
 public static void Edit(Sys sys)
 {
     string sql = " update LSys" + sys.Language.ToString() + " set value='" + sys.Value + "' where name='" + sys.Name + "'";
     SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionString, CommandType.Text, sql.ToString());
 }
Ejemplo n.º 6
0
 public static void Update(Sys sys)
 {
     if (DAL.LanguageService.GetLanguageById(sys.Language) != null)
         DAL.SysService.Edit(sys);
 }
Ejemplo n.º 7
0
 public static void Delete(Sys sys)
 {
     DAL.SysService.Delete(sys);
 }
Ejemplo n.º 8
0
 public static void Add(Sys sys)
 {
     if (DAL.LanguageService.GetLanguageById(sys.Language) != null)
         DAL.SysService.Add(sys);
 }