Beispiel #1
0
        public PRO_tblProductGroupLevel2DTO GetDataByID(string username, string language_id, string level2_id)
        {
            PRO_tblProductGroupLevel2DTO result = new PRO_tblProductGroupLevel2DTO();

            try
            {
                DataTable data = db.GetDataTable("PRO_spfrmProductGroupLevel2", new string[] { "Activity", "Username", "LanguageID", "Level2ID" }, new object[] { BaseConstant.COMMAND_GET_DATA_BY_ID_EN, username, language_id, level2_id });
                if (data != null && data.Rows.Count > 0)
                {
                    result = ConvertEngine.ConvertDataTableToObjectList <PRO_tblProductGroupLevel2DTO>(data)[0];
                    return(result);
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex);
            }

            return(result);
        }
Beispiel #2
0
        public string InsertLevel2(PRO_tblProductGroupLevel2DTO item)
        {
            string strError = "";

            try
            {
                strError = db.sExecuteSQL("PRO_spfrmProductGroupLevel2", new string[] { "Activity", "Username", "LanguageID", "Level2Code", "Level2ShortCode", "Level1ID", "VNName", "ENName", "Rank", "Used", "Note", "Description" }, new object[] { item.Activity, item.UserID, item.LanguageID, item.Level2Code, item.Level2ShortCode, item.Level1ID, 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);
        }