public int SaveLevel2(string funName, string DeptID, string Seq) { int ok = -1; MySQLConnection con = new MySQLConnection(); try { con.open(); SqlCommand cmd = new SqlCommand("usp_SaveNewOrgLeve2", con.con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@OK", SqlDbType.Int); parm.Direction = ParameterDirection.Output; cmd.Parameters.AddWithValue("@FunName", funName); cmd.Parameters.AddWithValue("@DeptID", DeptID); cmd.Parameters.AddWithValue("@Seq", Seq); cmd.Parameters.Add(parm); cmd.ExecuteNonQuery(); ok = Convert.ToInt32(cmd.Parameters["@OK"].Value); cmd.Dispose(); } catch (Exception ex) { string sssssssss = ex.Message; sssssssss = ""; } finally { con.Close(); } return(ok); }
public int UpdateLevel1(string DeptName, string id, string Seq) { int ok = -1; MySQLConnection con = new MySQLConnection(); try { con.open(); SqlCommand cmd = new SqlCommand("usp_UpdateNewOrgLeve1", con.con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@OK", SqlDbType.Int); parm.Direction = ParameterDirection.Output; cmd.Parameters.AddWithValue("@DeptName", DeptName); cmd.Parameters.AddWithValue("@ID", id); cmd.Parameters.AddWithValue("@Seq", Seq); cmd.Parameters.Add(parm); cmd.ExecuteNonQuery(); ok = Convert.ToInt32(cmd.Parameters["@OK"].Value); cmd.Dispose(); } catch (Exception ex) { } finally { con.Close(); } return(ok); }