Пример #1
0
 public async Task <bool> Delete(SLAStatus SLAStatus)
 {
     if (await ValidateId(SLAStatus))
     {
     }
     return(SLAStatus.IsValidated);
 }
Пример #2
0
        public async Task <SLAStatus> Get(long Id)
        {
            SLAStatus SLAStatus = await UOW.SLAStatusRepository.Get(Id);

            if (SLAStatus == null)
            {
                return(null);
            }
            return(SLAStatus);
        }
Пример #3
0
        public TicketReport_SLAStatusDTO(SLAStatus SLAStatus)
        {
            this.Id = SLAStatus.Id;

            this.Code = SLAStatus.Code;

            this.Name = SLAStatus.Name;

            this.ColorCode = SLAStatus.ColorCode;

            this.Errors = SLAStatus.Errors;
        }
Пример #4
0
        public Customer_SLAStatusDTO(SLAStatus SLAStatus)
        {
            this.Id = SLAStatus.Id;

            this.Code = SLAStatus.Code;

            this.Name = SLAStatus.Name;

            this.ColorCode = SLAStatus.ColorCode;

            this.Errors = SLAStatus.Errors;
        }
Пример #5
0
        /// <summary>
        /// Get status of SLA
        /// </summary>
        /// <param name="TenantID"></param>
        /// <returns></returns>
        public List <SLAStatus> GetSLAStatusList(int TenantID)
        {
            DataSet          ds   = new DataSet();
            MySqlCommand     cmd  = new MySqlCommand();
            List <SLAStatus> slas = new List <SLAStatus>();

            try
            {
                conn.Open();
                cmd.Connection = conn;
                MySqlCommand cmd1 = new MySqlCommand("SP_GetSLAStatusList", conn);
                cmd1.CommandType = CommandType.StoredProcedure;
                cmd1.Parameters.AddWithValue("@Tenant_Id", TenantID);
                MySqlDataAdapter da = new MySqlDataAdapter();
                da.SelectCommand = cmd1;
                da.Fill(ds);
                if (ds != null && ds.Tables[0] != null)
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        SLAStatus sla = new SLAStatus();
                        sla.SLAId              = Convert.ToInt32(ds.Tables[0].Rows[i]["SlaId"]);
                        sla.SLATargetId        = Convert.ToInt32(ds.Tables[0].Rows[i]["SLATargetId"]);
                        sla.TenatID            = Convert.ToInt32(ds.Tables[0].Rows[i]["TenantId"]);
                        sla.SLARequestResponse = Convert.ToString(ds.Tables[0].Rows[i]["Respond"]) + "/" + Convert.ToString(ds.Tables[0].Rows[i]["Resolution"]);

                        slas.Add(sla);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                if (conn != null)
                {
                    conn.Close();
                }
                if (ds != null)
                {
                    ds.Dispose();
                }
            }

            return(slas);
        }
Пример #6
0
        public async Task <SLAStatus> Get(long Id)
        {
            SLAStatus SLAStatus = await DataContext.SLAStatus.AsNoTracking()
                                  .Where(x => x.Id == Id)
                                  .Select(x => new SLAStatus()
            {
                Id        = x.Id,
                Code      = x.Code,
                Name      = x.Name,
                ColorCode = x.ColorCode,
            }).FirstOrDefaultAsync();

            if (SLAStatus == null)
            {
                return(null);
            }

            return(SLAStatus);
        }
Пример #7
0
        public async Task <bool> ValidateId(SLAStatus SLAStatus)
        {
            SLAStatusFilter SLAStatusFilter = new SLAStatusFilter
            {
                Skip = 0,
                Take = 10,
                Id   = new IdFilter {
                    Equal = SLAStatus.Id
                },
                Selects = SLAStatusSelect.Id
            };

            int count = await UOW.SLAStatusRepository.Count(SLAStatusFilter);

            if (count == 0)
            {
                SLAStatus.AddError(nameof(SLAStatusValidator), nameof(SLAStatus.Id), ErrorCode.IdNotExisted);
            }
            return(count == 1);
        }
Пример #8
0
 public async Task <bool> Create(SLAStatus SLAStatus)
 {
     return(SLAStatus.IsValidated);
 }