Beispiel #1
0
        public static tblIndustry gettbinduustryobjectbySIC(int i)
        {
            tblIndustry  empQuery = null;
            PEIEntities7 Ganesh   = new PEIEntities7();

            empQuery = Ganesh.tblIndustries.Where(o => o.SIC.Value.Equals(i)).FirstOrDefault();

            return(empQuery);
        }
        public async Task <IndustryCreateModel> UpdateIndustry(IndustryCreateModel model)
        {
            try
            {
                tblIndustry data = await Task.Run(() => ManageIndustry_Skills.UpdateIndustry(model.ConvertTotblIndustry()));

                return(data.ConvertToIndustry());
            }
            catch (Exception)
            {
                throw;
            }
        }
        public async Task <IndustryCreateModel> CreateIndustry(IndustryCreateModel data)
        {
            try
            {
                tblIndustry dataIndustry = await Task.Run(() => ManageIndustry_Skills.InsertIndustry(data.ConvertTotblIndustry()));

                return(dataIndustry.ConvertToIndustry());
            }
            catch (Exception)
            {
                throw;
            }
        }
 public static IndustryCreateModel ConvertToIndustry(this tblIndustry data)
 {
     return(new IndustryCreateModel()
     {
         id = data.ID,
         industryDescription = data.Description,
         industryName = data.Name,
         isActive = data.IsActive,
         isDeleted = data.IsDeleted,
         createdUserID = data.CreatedUserID,
         updatedUserID = data.UpdatedUserID,
         createdTimestamp = data.CreatedTimestamp,
         updatedTimestamp = data.UpdatedTimestamp
     });
 }
        public async Task <IndustryCreateModel> GetIndustry(long Id)
        {
            try
            {
                IndustryCreateModel model = null;
                tblIndustry         data  = await Task.Run(() => ManageIndustry_Skills.GetIndustry(Id));

                model = data.ConvertToIndustry();

                return(model);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #6
0
        internal static async Task DeleteIndustry(long Id)
        {
            try
            {
                using (db = new eMSPEntities())
                {
                    tblIndustry obj = await db.tblIndustries.FindAsync(Id);

                    db.tblIndustries.Remove(obj);
                    int x = await Task.Run(() => db.SaveChangesAsync());
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #7
0
        internal static async Task <tblIndustry> UpdateIndustry(tblIndustry model)
        {
            try
            {
                using (db = new eMSPEntities())
                {
                    db.Entry(model).State = EntityState.Modified;

                    int x = await Task.Run(() => db.SaveChangesAsync());

                    return(model);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #8
0
        internal static async Task <tblIndustry> InsertIndustry(tblIndustry model)
        {
            try
            {
                using (db = new eMSPEntities())
                {
                    model = db.tblIndustries.Add(model);

                    int x = await Task.Run(() => db.SaveChangesAsync());

                    return(model);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }