Ejemplo n.º 1
0
        public JsonResult Delete(ADM_DEF_NATIONAL bnk)
        {
            ADM_DEF_NATIONAL data = db.ADM_DEF_NATIONAL.Find(bnk.CODE);

            db.ADM_DEF_NATIONAL.Remove(data);
            db.SaveChanges();
            return(Json(JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public JsonResult Update(ADM_DEF_NATIONAL bank)
        {
            ADM_DEF_NATIONAL def = db.ADM_DEF_NATIONAL.Find(bank.CODE);

            def.CODE         = bank.CODE;
            def.DESC         = bank.DESC;
            def.AUTH_BY      = bank.AUTH_BY;
            def.AUTH_DATE    = bank.AUTH_DATE;
            def.AUTH_REMARKS = bank.AUTH_REMARKS;
            def.AUTH_STATUS  = bank.AUTH_STATUS;
            def.INACTIVE_IMS = bank.INACTIVE_IMS;
            def.INACTIVE_LMS = bank.INACTIVE_LMS;
            def.INACTIVE_MFL = bank.INACTIVE_MFL;
            db.SaveChanges();

            return(Json(JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 3
0
        public JsonResult Add(ADM_DEF_NATIONAL bnkObj)
        {
            SqlConnection con = new SqlConnection(connectionstring);
            SqlCommand    cmd = new SqlCommand("", con);

            cmd.CommandText = "SELECT MAX(CODE) FROM ADM_DEF_NATIONAL";
            con.Open();
            var code = cmd.ExecuteScalar();

            if (code == DBNull.Value)
            {
                code = 0;
            }

            con.Close();
            code        = Convert.ToInt32(code) + 1;
            bnkObj.CODE = Convert.ToDecimal(code);
            db.ADM_DEF_NATIONAL.Add(bnkObj);
            db.SaveChanges();
            return(Json(JsonRequestBehavior.AllowGet));
        }