示例#1
0
        // MP-846 Admin database cleanup and code cleanup.-MASTER
        internal TicketEntity GetLastTicketAuditByTicketIdByMaster(int TicketId)
        {
            TicketEntity results = new TicketEntity();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "mapp.GetLastTicketAuditByTicketId";
                sproc.StoredProceduresParameter.Add(GetParam("@TicketId", TicketId.ToString(), SQLServerDatatype.IntDataType));
                DataTable dt;
                dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc);
                if (dt != null && dt.Rows.Count > 0)
                {
                    TicketAdapter ta = new TicketAdapter();
                    foreach (DataRow rw in dt.Rows)
                    {
                        results = ta.AdaptItem(rw, dt);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(results);
        }
示例#2
0
        internal List <TicketEntity> GetTicketListByUser(string ClientInformation, string EnteredBy, int SortOrder, int PageNumber, int PageSize, out int TotalRecords)
        {
            TotalRecords = 0;
            List <TicketEntity> results = new List <TicketEntity>();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "capp.GetTicketListByUser";   // MP-846 Admin database cleanup and code cleanup.
                sproc.StoredProceduresParameter.Add(GetParam("@ClientInformation", ClientInformation.ToString(), SQLServerDatatype.VarcharDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@EnteredBy", EnteredBy.ToString(), SQLServerDatatype.VarcharDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@SortOrder", SortOrder.ToString(), SQLServerDatatype.IntDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@PageNumber", PageNumber.ToString(), SQLServerDatatype.IntDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@PageSize", PageSize.ToString(), SQLServerDatatype.IntDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@TotalRecords", TotalRecords.ToString(), SQLServerDatatype.IntDataType, ParameterDirection.Output));

                string    outParam = "";
                DataTable dt;
                dt = sql.ExecuteDataTableWithOutputParam(CommandType.StoredProcedure, sproc, out outParam);
                if (dt != null && dt.Rows.Count > 0)
                {
                    results      = new TicketAdapter().Adapt(dt);
                    TotalRecords = Convert.ToInt32(outParam);
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(results);
        }
示例#3
0
        // Get Ticket List
        internal List <TicketEntity> GetTicketList(int SortOrder, int PageNumber, int PageSize, out int TotalRecords, int?Priority, string CurrentStatus, string Title, string ClientInformation, string TicketType, string AssignedTo)
        {
            List <TicketEntity> results = new List <TicketEntity>();

            try
            {
                TotalRecords = 0;
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "mapp.GetTicketList";   // MP-846 Admin database cleanup and code cleanup.
                sproc.StoredProceduresParameter.Add(GetParam("@SortOrder", SortOrder.ToString(), SQLServerDatatype.IntDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@PageNumber", PageNumber.ToString(), SQLServerDatatype.IntDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@PageSize", PageSize.ToString(), SQLServerDatatype.IntDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@TotalRecords", TotalRecords.ToString(), SQLServerDatatype.IntDataType, ParameterDirection.Output));
                sproc.StoredProceduresParameter.Add(GetParam("@Priority", Priority != null ? Priority.ToString() : null, SQLServerDatatype.IntDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@CurrentStatus", !string.IsNullOrEmpty(CurrentStatus) ? CurrentStatus.ToString() : null, SQLServerDatatype.VarcharDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@Title", Title, SQLServerDatatype.VarcharDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@ClientInformation", !string.IsNullOrEmpty(ClientInformation) ? ClientInformation.ToString() : null, SQLServerDatatype.VarcharDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@TicketType", string.IsNullOrEmpty(TicketType) ? null : TicketType.ToString(), SQLServerDatatype.IntDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@AssignedTo", string.IsNullOrEmpty(AssignedTo) ? null : AssignedTo.ToString(), SQLServerDatatype.IntDataType));
                string    outParam = "";
                DataTable dt;
                dt = sql.ExecuteDataTableWithOutputParam(CommandType.StoredProcedure, sproc, out outParam);
                if (dt != null && dt.Rows.Count > 0)
                {
                    results      = new TicketAdapter().Adapt(dt);
                    TotalRecords = Convert.ToInt32(outParam);
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(results);
        }
示例#4
0
        // MP-846 Admin database cleanup and code cleanup.-MASTER
        internal List <TicketStatus> GetAttributeTypeForTicketForMaster(string Code)
        {
            List <TicketStatus> results = new List <TicketStatus>();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "mapp.GetAttributeTypeForTicket";
                sproc.StoredProceduresParameter.Add(GetParam("@TypeCode", Code.ToString(), SQLServerDatatype.VarcharDataType));
                DataTable dt;
                dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc);
                if (dt != null && dt.Rows.Count > 0)
                {
                    results = new TicketAdapter().AdaptTicketUtil(dt);
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(results);
        }
示例#5
0
        internal List <TicketEntity> GetTicketListByAssignedTo(int AssignedTo)
        {
            List <TicketEntity> results = new List <TicketEntity>();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "tkt.GetTicketListByAssignedTo";
                sproc.StoredProceduresParameter.Add(GetParam("@Id", AssignedTo.ToString(), SQLServerDatatype.IntDataType));
                DataTable dt;
                dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc);
                if (dt != null && dt.Rows.Count > 0)
                {
                    results = new TicketAdapter().Adapt(dt);
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(results);
        }