Exemple #1
0
        public JsonResult SearchOpInsByCodeNo(string CodeNumber)
        {
            OperatingInstructionDataAccess obj = new OperatingInstructionDataAccess();
            tbl_OperatingInstructions      lst = new tbl_OperatingInstructions();

            lst = obj.GetOperatingInstructionsbyCode(CodeNumber);
            if (lst != null)
            {
                return(Json(new { result = lst, ErrorMessage = CustomMessages.Success }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { result = lst, ErrorMessage = CustomMessages.NoValueExist }, JsonRequestBehavior.AllowGet));
            }
        }
Exemple #2
0
 public tbl_OperatingInstructions GetOperatingInstructionsbyID(int ID)
 {
     try
     {
         tbl_OperatingInstructions row = new tbl_OperatingInstructions();
         using (var db = new SoneriCISEntities())
         {
             row = db.tbl_OperatingInstructions.FirstOrDefault(e => e.ID == ID);
         }
         return(row);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #3
0
 public bool AddOperatingInstruction(tbl_OperatingInstructions row)
 {
     try
     {
         using (var db = new SoneriCISEntities())
         {
             db.tbl_OperatingInstructions.Add(row);
             db.SaveChanges();
         }
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Exemple #4
0
        public bool DeleteOperatingInstructions(tbl_OperatingInstructions row)
        {
            try
            {
                using (var db = new SoneriCISEntities())
                {
                    tbl_OperatingInstructions val = new tbl_OperatingInstructions();
                    val          = db.tbl_OperatingInstructions.Where(a => a.ID == row.ID).FirstOrDefault();
                    val.IsActive = false;

                    db.SaveChanges();
                }
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Exemple #5
0
 public bool UpdateOperatingInstructions(tbl_OperatingInstructions row)
 {
     try
     {
         using (var db = new SoneriCISEntities())
         {
             tbl_OperatingInstructions val = new tbl_OperatingInstructions();
             val             = db.tbl_OperatingInstructions.Where(a => a.Code == row.Code).FirstOrDefault();
             val.Code        = row.Code;
             val.Description = row.Description;
             val.IsActive    = row.IsActive;
             db.SaveChanges();
         }
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Exemple #6
0
        public JsonResult UpdateOperatingInstruction(string OperatingInstruction, string Code, bool?IsActive)
        {
            bool success;
            OperatingInstructionDataAccess obj = new OperatingInstructionDataAccess();
            tbl_OperatingInstructions      lst = new tbl_OperatingInstructions();

            //ConfigurationVM lst = new ConfigurationVM();
            lst.Description = OperatingInstruction;
            lst.Code        = Code;

            lst.IsActive = IsActive;
            success      = obj.UpdateOperatingInstructions(lst);
            if (success == true)
            {
                return(Json(new { result = success, ErrorMessage = CustomMessages.Success }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { result = success, ErrorMessage = CustomMessages.GenericErrorMessage }, JsonRequestBehavior.AllowGet));
            }
        }
Exemple #7
0
 public bool CheckPostingCode(string Code)
 {
     try
     {
         tbl_OperatingInstructions row = new tbl_OperatingInstructions();
         using (var db = new SoneriCISEntities())
         {
             row = db.tbl_OperatingInstructions.FirstOrDefault(e => e.Code == Code && e.IsActive == true);
         }
         if (row != null)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         return(false);
     }
 }