//===============================================
        public void increase_shareha_charge(int shareehaId, float value)
        {
            shareha sh = DB.shareha.Where(s => s.id == shareehaId).Single();

            sh.value          += value;
            DB.Entry(sh).State = EntityState.Modified;
            DB.SaveChanges();
        }
Example #2
0
//=============================================================================
        public void increase_shareha_charge(int serviceId, float quantity)
        {
            int shId = (int)DB.services.Where(s => s.id == serviceId).Single().sharehaId;

            shareha shr = DB.shareha.Where(sh => sh.id == shId).Single();

            shr.value          += quantity;
            DB.Entry(shr).State = EntityState.Modified;
            DB.SaveChanges();
        }
Example #3
0
        public JsonResult delete_shareeha(int id)
        {
            try
            {
                shareha tc = DB.shareha.Where(t => t.id == id).Single();
                DB.shareha.Remove(tc);
                DB.SaveChanges();

                return(Json(new { msg = "تم حذف الشريحه بنجاح" }));
            }
            catch
            {
                return(Json(new { msg = "لم تتم عمليه الحذف .. حاول مره اخري" }));
            }
        }
Example #4
0
        public JsonResult update_shareeha(int id, string name, double value)
        {
            try
            {
                shareha ch = DB.shareha.Where(s => s.id == id).Single();
                ch.name  = name;
                ch.value = value;

                DB.Entry(ch).State = EntityState.Modified;
                DB.SaveChanges();

                return(Json(new { msg = "تم تعديل بيانات الشريحه بنجاح" }));
            }
            catch
            {
                return(Json(new { msg = "لم تتم عمليه التعديل .. حاول مره اخري" }));
            }
        }
Example #5
0
        public JsonResult add_shareeha(string name, double value)
        {
            try
            {
                shareha ch = new shareha();
                ch.name  = name;
                ch.value = value;

                DB.shareha.Add(ch);
                DB.SaveChanges();

                return(Json(new { msg = "تم اضافه الشريحه بنجاح" }));
            }
            catch
            {
                return(Json(new { msg = "لم تتم عمليه الاضافه .. حاول مره اخري" }));
            }
        }