Ejemplo n.º 1
0
 protected void SectionSaveButton_Click(object sender, EventArgs e)
 {
     try
     {
         DepartmentEntry aDepartmentEntry = new DepartmentEntry();
         txtFacultyId.Text            = aDepartmentEntryManager.GetDepartmentAutoId();
         aDepartmentEntry.DeptId      = txtFacultyId.Text.Trim();
         aDepartmentEntry.DeptName    = txtFacultyName.Text.Trim();
         aDepartmentEntry.CollegeName = ddlCourseName.SelectedValue;
         aDepartmentEntryManager.SaveDepartmentInformation(aDepartmentEntry);
         RefreshAll();
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ale", "alert('Record(s) is/are created suceessfullly...!!');", true);
     }
     catch (FormatException fex)
     {
         ClientScript.RegisterStartupScript(this.GetType(), "Warning", "alert('" + fex.Message + "');", true);
     }
     catch (Exception ex)
     {
         if (ex.Message.Contains("Database"))
         {
             ClientScript.RegisterStartupScript(this.GetType(), "Warning", "alert('Database Maintain Error. Contact to the Software Provider..!!');", true);
         }
         else
         {
             ClientScript.RegisterStartupScript(this.GetType(), "Warning", "alert('There is some problem to do the task. Try again properly.!!');", true);
         }
     }
 }
Ejemplo n.º 2
0
    public void UpdateDepartmentInformation(DepartmentEntry aDepartmentEntry)
    {
        string connectionString = DataManager.OraConnString();
        string updateQuery      = @"UPDATE [Department_Info]
   SET [DeptName] = '" + aDepartmentEntry.DeptName + "',[CollegeId] = '" + aDepartmentEntry.CollegeName + "' WHERE [DeptId]='" + aDepartmentEntry.DeptId + "'";

        DataManager.ExecuteNonQuery(connectionString, updateQuery);
    }
Ejemplo n.º 3
0
    public void DeleteDepartmentInformation(DepartmentEntry aDepartmentEntry)
    {
        string connectionString = DataManager.OraConnString();

        string deleteQuery = @"DELETE FROM [Department_Info]
      WHERE [DeptId]='" + aDepartmentEntry.DeptId + "' ";

        DataManager.ExecuteNonQuery(connectionString, deleteQuery);
    }
Ejemplo n.º 4
0
    public void SaveDepartmentInformation(DepartmentEntry aDepartmentEntry)
    {
        string connectionString = DataManager.OraConnString();
        string insertQuery      = @"INSERT INTO [Department_info]
           ( [DeptId]
           ,[DeptName]
           ,[CollegeId])
     VALUES('" + aDepartmentEntry.DeptId + "','" + aDepartmentEntry.DeptName + "','" + aDepartmentEntry.CollegeName + "')";

        DataManager.ExecuteNonQuery(connectionString, insertQuery);
    }