public ActionResult DeleteConfirmed(int id) { ope ope = db.Opes.Find(id); db.Opes.Remove(ope); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(ope ope) { if (ModelState.IsValid) { db.Entry(ope).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ope)); }
public ActionResult Create(ope ope) { if (ModelState.IsValid) { db.Opes.Add(ope); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ope)); }
//[HttpPost] //[AllowAnonymous] public ActionResult sh(ope ope) { var excelApp = new Microsoft.Office.Interop.Excel.Application(); string myPath = ope.openn; var workbook = excelApp.Workbooks.Open(myPath, 0, false, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", true, false, 0, true, 1, 0); excelApp.Visible = true; return(new JsonResult { Data = "dummy", JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
string str_connection = ConfigurationManager.ConnectionStrings["GlobalInfo"].ConnectionString; // // GET: /Ope/ public ViewResult Index() { List <opeIndex> arrModel = new List <opeIndex>(); string str_query = "select op.id, numero_processo, data_abertura, data_chegada, es.nome from opes op join escolas es on es.id=op.escolas_id"; using (SqlConnection conn = new SqlConnection(str_connection)) using (SqlCommand cmd = new SqlCommand(str_query, conn)) { conn.Open(); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { string nome = reader["nome"].ToString(); string numero_processo = reader["numero_processo"].ToString(); string data_abertura = reader["data_abertura"].ToString(); string data_chegada = reader["data_chegada"].ToString(); int nId = Convert.ToInt32(reader["id"]); opeIndex objOPE = new opeIndex(); ope objope = new ope(); objope.numero_processo = numero_processo; objope.data_abertura = data_abertura; objope.data_chegada = data_chegada; objOPE.nome = nome; objOPE.id = nId; objOPE.ope = objope; /////// opevis model arrModel.Add(objOPE); } conn.Close(); } return(View(arrModel)); }
public Result run_operation(int a, int b, ope op) { Result A; switch (op) { case ope.ADD: A = ADD(a, b); break; case ope.SUB: A = SUB(a, b); break; case ope.MULT: A = MULT(a, b); break; case ope.DIV: A = DIV(a, b); break; case ope.REV: A = REV(a); break; case ope.POW: A = POW(a, b); break; default: A = new Result("ERROR"); break; } return(A); }
private void set_TB(string sender) { if (done == true) { num_display = ""; curr_operation = ""; done = false; } switch (get_type(sender)) { case b_type.number: num_display += sender; curr_operation += sender; temp_op = num_display; break; case b_type.operation: if (op_Type == ope.DIV) { aa = Convert.ToDouble(num_display); } // a = Convert.ToDouble(num_display); //Double.TryParse(num_display, out a); a = Int32.Parse(num_display); operand = sender; op_Type = get_operation(sender); curr_operation = temp_op + " " + operand + " "; num_display = ""; break; case b_type.clear: done = true; break; case b_type.delete: break; case b_type.result: if (op_Type == ope.REV) { b = 0; } else { b = Int32.Parse(num_display); } A = run_operation(a, b, op_Type); curr_operation += " ="; num_display = A.b; done = true; break; default: break; } }
// // GET: /Ope/Delete/5 public ActionResult Delete(int id) { ope ope = db.Opes.Find(id); return(View(ope)); }
// // GET: /Ope/Details/5 public ViewResult Details(int id) { ope ope = db.Opes.Find(id); return(View(ope)); }