public PRO_tblProductGroupLevel1DTO GetDataByID(string username, string language_id, string level1_id) { PRO_tblProductGroupLevel1DTO result = new PRO_tblProductGroupLevel1DTO(); try { DataTable data = db.GetDataTable("PRO_spfrmProductGroupLevel1", new string[] { "Activity", "Username", "LanguageID", "Level1ID" }, new object[] { BaseConstant.COMMAND_GET_DATA_BY_ID_EN, username, language_id, level1_id }); if (data != null && data.Rows.Count > 0) { result = ConvertEngine.ConvertDataTableToObjectList<PRO_tblProductGroupLevel1DTO>(data)[0]; return result; } } catch (Exception ex) { logger.Error(ex); } return result; }
public string InsertLevel1(PRO_tblProductGroupLevel1DTO item) { string strError = ""; try { strError = db.sExecuteSQL("PRO_spfrmProductGroupLevel1", new string[] { "Activity", "Username", "LanguageID", "Level1Code", "Level1ShortCode", "VNName", "ENName", "Rank", "Used", "Note", "Description" }, new object[] { item.Activity, item.UserID, item.LanguageID, item.Level1Code, item.Level1ShortCode, item.VNName, item.ENName, item.Rank, item.Used, item.Note, item.Description }); if (!string.IsNullOrEmpty(strError)) logger.Error(strError); return strError; } catch (Exception ex) { logger.Error(ex); strError = ex.Message; } return strError; }