public JsonResult Delete(ADM_DEF_FLOAT bnk) { ADM_DEF_FLOAT data = db.ADM_DEF_FLOAT.Find(bnk.CODE); db.ADM_DEF_FLOAT.Remove(data); db.SaveChanges(); return(Json(JsonRequestBehavior.AllowGet)); }
public JsonResult Add(ADM_DEF_FLOAT bnkObj) { SqlConnection con = new SqlConnection(connectionstring); SqlCommand cmd = new SqlCommand("", con); cmd.CommandText = "SELECT MAX(CODE) FROM ADM_DEF_FLOAT"; 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_FLOAT.Add(bnkObj); db.SaveChanges(); return(Json(JsonRequestBehavior.AllowGet)); }
public JsonResult Update(ADM_DEF_FLOAT bank) { ADM_DEF_FLOAT def = db.ADM_DEF_FLOAT.Find(bank.CODE); def.CODE = bank.CODE; def.DESC = bank.DESC; def.FLOAT_RATE = bank.FLOAT_RATE; def.FLOAT_DAYS = bank.FLOAT_DAYS; def.FLOAT_MONTH = bank.FLOAT_MONTH; def.FLOAT_FIX_DAY = bank.FLOAT_FIX_DAY; def.FLOAT_FIX_MONTH = bank.FLOAT_FIX_MONTH; def.KIBOR_MONTH = bank.KIBOR_MONTH; 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)); }