コード例 #1
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     if (txtEmpno.Text == string.Empty)
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "m2", "alert('Please enter id to search')", true);
     }
     else
     {
         try
         {
             int    searchid = Convert.ToInt32(txtEmpno.Text);
             Employ employ   = EmployBLL.GetEmployBLL(searchid);
             if (employ != null)
             {
                 txtname.Text  = employ.Name;
                 txtDept.Text  = employ.Department;
                 txtDesig.Text = employ.Designation;
                 txtbasic.Text = employ.Basic.ToString();
             }
             else
             {
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "m4", "alert('Employ not available')", true);
             }
         }
         catch (Exception ex)
         {
             ScriptManager.RegisterStartupScript(this, this.GetType(), "error1", "alert('" + ex.Message + "')", true);
         }
     }
 }
コード例 #2
0
        //public ActionResult Edit(int id, FormCollection collection)
        //{
        //    try
        //    {
        //        // TODO: Add update logic here

        //        return RedirectToAction("Index");
        //    }
        //    catch
        //    {
        //        return View();
        //    }
        //}

        // GET: Employ/Delete/5
        public ActionResult Delete(int id)
        {
            Employ employ = EmployBLL.GetEmployBLL(id);

            return(View(employ));
        }