public int Insert(SysLanguageModel model) { StringBuilder sql = new StringBuilder(); sql.Append("INSERT INTO SYSLANGUAGE"); sql.Append(" (LANGID,"); sql.Append(" CONTROLID,"); sql.Append(" CONTROLTYPE,"); sql.Append(" PAGEID,"); sql.Append(" DIALOGID,"); sql.Append(" ZH_CN,"); sql.Append(" ZH_TW,"); sql.Append(" EN_US,"); sql.Append(" DE_DE,"); sql.Append(" KO_KR,"); sql.Append(" JA_JP,"); sql.Append(" FR_FR,"); sql.Append(" RU_RU,"); sql.Append(" CREATEUSER)"); sql.Append("VALUES"); sql.Append(" ($LANGID,"); sql.Append(" $CONTROLID,"); sql.Append(" $CONTROLTYPE,"); sql.Append(" $PAGEID,"); sql.Append(" $DIALOGID,"); sql.Append(" $ZH_CN,"); sql.Append(" $ZH_TW,"); sql.Append(" $EN_US,"); sql.Append(" $DE_DE,"); sql.Append(" $KO_KR,"); sql.Append(" $JA_JP,"); sql.Append(" $FR_FR,"); sql.Append(" $RU_RU,"); sql.Append(" $CREATEUSER)"); sql.Append(""); SQLParameter[] parms = { new SQLParameter("LANGID", typeof(string), model.LANGID), new SQLParameter("CONTROLID", typeof(string), model.CONTROLID), new SQLParameter("CONTROLTYPE", typeof(string), model.CONTROLTYPE), new SQLParameter("PAGEID", typeof(string), model.PAGEID), new SQLParameter("DIALOGID", typeof(string), model.DIALOGID), new SQLParameter("ZH_CN", typeof(string), model.ZH_CN), new SQLParameter("ZH_TW", typeof(string), model.ZH_TW), new SQLParameter("EN_US", typeof(string), model.EN_US), new SQLParameter("DE_DE", typeof(string), model.DE_DE), new SQLParameter("KO_KR", typeof(string), model.KO_KR), new SQLParameter("JA_JP", typeof(string), model.JA_JP), new SQLParameter("FR_FR", typeof(string), model.FR_FR), new SQLParameter("RU_RU", typeof(string), model.RU_RU), new SQLParameter("CREATEUSER", typeof(string), model.CREATEUSER) }; int result = DB.CustomExecuteWithReturn(new SQLParamCondition(sql.ToString(), parms)); return(result); }
public IList <SysLanguageModel> GetByEasyUIAll(string langType) { DataTable dt = _languageRep.GetByEasyUIAll(); //List<SysLanguageModel> list = dt.ToList<SysLanguageModel>(); List <SysLanguageModel> list = new List <SysLanguageModel>(); foreach (DataRow dr in dt.Rows) { SysLanguageModel model = new SysLanguageModel(); model.CONTROLID = dr["CONTROLID"].ToString(); model.langValue = dr[langType.ToUpper()].ToString(); list.Add(model); } return(list); }
public IList <SysLanguageModel> GetById(string langType, string pageId, string dialogId) { DataTable dt = _languageRep.GetById(pageId, dialogId); //List<SysLanguageModel> list = dt.ToList<SysLanguageModel>(); List <SysLanguageModel> list = new List <SysLanguageModel>(); foreach (DataRow dr in dt.Rows) { SysLanguageModel model = new SysLanguageModel(); model.CONTROLID = dr["CONTROLID"].ToString(); model.CONTROLTYPE = dr["CONTROLTYPE"].ToString(); model.langValue = dr[langType.ToUpper()].ToString(); list.Add(model); } return(list); }
public int Edit(SysLanguageModel model) { StringBuilder sql = new StringBuilder(); sql.Append("UPDATE SYSLANGUAGE"); sql.Append(" SET CONTROLID = $CONTROLID,"); sql.Append(" CONTROLTYPE= $CONTROLTYPE,"); sql.Append(" PAGEID = $PAGEID,"); sql.Append(" DIALOGID = $DIALOGID,"); sql.Append(" ZH_CN = $ZH_CN,"); sql.Append(" ZH_TW = $ZH_TW,"); sql.Append(" EN_US = $EN_US,"); sql.Append(" DE_DE = $DE_DE,"); sql.Append(" KO_KR = $KO_KR,"); sql.Append(" JA_JP = $JA_JP,"); sql.Append(" FR_FR = $FR_FR,"); sql.Append(" RU_RU = $RU_RU"); sql.Append(" WHERE LANGID = $LANGID"); SQLParameter[] parms = { new SQLParameter("CONTROLID", typeof(string), model.CONTROLID), new SQLParameter("CONTROLTYPE", typeof(string), model.CONTROLTYPE), new SQLParameter("PAGEID", typeof(string), model.PAGEID), new SQLParameter("DIALOGID", typeof(string), model.DIALOGID), new SQLParameter("ZH_CN", typeof(string), model.ZH_CN), new SQLParameter("ZH_TW", typeof(string), model.ZH_TW), new SQLParameter("EN_US", typeof(string), model.EN_US), new SQLParameter("DE_DE", typeof(string), model.DE_DE), new SQLParameter("KO_KR", typeof(string), model.KO_KR), new SQLParameter("JA_JP", typeof(string), model.JA_JP), new SQLParameter("FR_FR", typeof(string), model.FR_FR), new SQLParameter("RU_RU", typeof(string), model.RU_RU), new SQLParameter("LANGID", typeof(string), model.LANGID), }; int result = DB.CustomExecuteWithReturn(new SQLParamCondition(sql.ToString(), parms)); return(result); }