Esempio n. 1
0
        public async Task <ActionMessage> createAnalyzerGroup2(AnalyzerGroupInfo _AnalyzerGroup, string _userI)
        {
            ActionMessage        ret           = new ActionMessage();
            int                  insetId       = -1;
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                try
                {
                    insetId = AnalyzerGroupDataLayer.GetInstance().InsertAnalyzerGroup(connection, _AnalyzerGroup, _userI);
                    //TODO: insert member
                    // ret.isSuccess = true;
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                if (insetId > -1)
                {
                    ret.id        = insetId;
                    ret.isSuccess = true;
                }
                else
                {
                    ret.isSuccess     = false;
                    ret.err.msgCode   = "lỗi thêm nhóm tài sản";
                    ret.err.msgString = "lỗi thêm nhóm tài sản";
                }
                return(ret);
            }
        }
Esempio n. 2
0
        public List <AnalyzerGroupInfo> getAllAnalyzerGroup(AnalyzerGroupSeachCriteria _criteria)
        {
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                return(AnalyzerGroupDataLayer.GetInstance().GetAllAnalyzerGroup(connection, _criteria));
            }
        }
Esempio n. 3
0
        public int getTotalRecords(AnalyzerGroupSeachCriteria _criteria)
        {
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                return(AnalyzerGroupDataLayer.GetInstance().getTotalRecords(connection, _criteria));
            }
        }
Esempio n. 4
0
        public List <string> getListAnalyzerGroupCode(string AnalyzerGroupCode)
        {
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                List <string> ListAnalyzerGroup = AnalyzerGroupDataLayer.GetInstance().getListAnalyzerGroupCode(connection, AnalyzerGroupCode);
                return(ListAnalyzerGroup);
            }
        }
Esempio n. 5
0
        public AnalyzerGroupInfo getAnalyzerGroup(int _ID)
        {
            AnalyzerGroupInfo    record        = new AnalyzerGroupInfo();
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                record = AnalyzerGroupDataLayer.GetInstance().getAnalyzerGroup(connection, _ID);
                if (record == null)
                {
                    return(null);
                }
                return(record);
            }
        }
Esempio n. 6
0
        public AnalyzerGroupInfo GetAnalyzerGroupByCode(string code)
        {
            AnalyzerGroupInfo    record        = new AnalyzerGroupInfo();
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                record = AnalyzerGroupDataLayer.GetInstance().GetAnalyzerGroupByCode(connection, code);
                if (record == null)
                {
                    return(null);
                }

                return(record);
            }
        }
Esempio n. 7
0
        public ActionMessage createAnalyzerGroup(AnalyzerGroupInfo _AnalyzerGroup, string _userI)
        {
            ActionMessage        ret           = new ActionMessage();
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                try
                {
                    ret.id        = AnalyzerGroupDataLayer.GetInstance().InsertAnalyzerGroup(connection, _AnalyzerGroup, _userI);
                    ret.isSuccess = true;
                }
                catch (Exception ex)
                {
                    ret.isSuccess     = false;
                    ret.err.msgCode   = "123";
                    ret.err.msgString = ex.Message;
                }
            }
            return(ret);
        }
Esempio n. 8
0
        public ActionMessage DeleteMuti(string ids)
        {
            ActionMessage ret = new ActionMessage();

            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                try
                {
                    AnalyzerGroupDataLayer.GetInstance().DeleteMuti(connection, ids);
                    ret.isSuccess = true;
                }
                catch (Exception ex)
                {
                    ret.isSuccess     = false;
                    ret.err.msgCode   = "Internal Error";
                    ret.err.msgString = ex.Message;
                }
            }
            return(ret);
        }
Esempio n. 9
0
        public async Task <ActionMessage> editAnalyzerGroup(int id, AnalyzerGroupInfo _AnalyzerGroup, string _userU)
        {
            ActionMessage        ret           = new ActionMessage();
            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                var chkAnalyzerGroupInfo = AnalyzerGroupDataLayer.GetInstance().getAnalyzerGroup(connection, id);
                if (chkAnalyzerGroupInfo != null)
                {
                    try
                    {
                        AnalyzerGroupDataLayer.GetInstance().UpdateAnalyzerGroup(connection, id, _AnalyzerGroup, _userU);
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
                ret.isSuccess = true;
                return(ret);
            }
        }