Ejemplo n.º 1
0
        public static bool EditSalary(Monthlysalary tb)
        {
            try
            {
                db = new UcasProEntities();
                db.Configuration.LazyLoadingEnabled = false;
                db.Configuration.ProxyCreationEnabled = false;
                var q = db.Monthlysalaries.Where(p => p.ID == tb.ID).SingleOrDefault();
                q.ContractID = tb.ContractID;
                q.IssueDate = tb.IssueDate;
                q.Amount = tb.Amount;
                q.Formonth = tb.Formonth;
               

                db.SaveChanges();
                return true;

            }
            catch (Exception ex)
            {


                Xprema.XpremaException e = new Xprema.XpremaException();
                e.CodeNumber = 6;
                e.OtherDescription = ex.InnerException.InnerException.Message;
                e.UserDescription = "Error in Save Changed";
                e.UserDescriptionArabic = "خطاء في حفظ البيانات";
                throw e;
            }
        }
Ejemplo n.º 2
0
        public static bool NewSalary(Monthlysalary tb)
        {
            try
            {
                db = new UcasProEntities();
                
                db.Monthlysalaries.Add(tb);
                db.SaveChanges();
                return true;

            }
            catch (Exception ex)
            {

                Xprema.XpremaException e = new Xprema.XpremaException();
                e.CodeNumber = 6;
                e.OtherDescription = ex.InnerException.InnerException.Message;
                e.UserDescription = "Error in Save Changed";
                e.UserDescriptionArabic = "خطاء في اضافة البيانات";
                throw e;
            }
        }