public string ForgotPasswordEmailBody(string Email, string NewPassword) { DataTable dt = new DataTable(); string returntxt = string.Empty; MySQLConnection con = new MySQLConnection(); try { con.open(); SqlCommand cmd = new SqlCommand("usp_ForgotPasswordEmailBody", con.con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@email", Email); cmd.Parameters.AddWithValue("@password", NewPassword); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dt); if (dt != null && dt.Rows.Count > 0) { returntxt = Convert.ToString(dt.Rows[0]["EmailBody"]); } cmd.Dispose(); } catch (Exception ex) { } finally { con.Close(); } return(returntxt); }
public string UserEmail(string userid) { DataTable dt = new DataTable(); string returntxt = string.Empty; MySQLConnection con = new MySQLConnection(); try { con.open(); SqlCommand cmd = new SqlCommand("Select Email from TblHResources where User_ID = " + userid, con.con); cmd.CommandType = CommandType.Text; SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dt); if (dt != null && dt.Rows.Count > 0) { returntxt = Convert.ToString(dt.Rows[0]["Email"]); } cmd.Dispose(); } catch (Exception ex) { } finally { con.Close(); } return(returntxt); }
public string GetChartOfAccount() { DataTable dt = new DataTable(); string returntxt = string.Empty; MySQLConnection con = new MySQLConnection(); try { con.open(); SqlCommand cmd = new SqlCommand("usp_DisplayChartOfAccount", con.con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@myReturnString", SqlDbType.VarChar, 50000); parm.Direction = ParameterDirection.Output; cmd.Parameters.Add(parm); cmd.ExecuteNonQuery(); returntxt = Convert.ToString(cmd.Parameters["@myReturnString"].Value); cmd.Dispose(); } catch (Exception ex) { } finally { con.Close(); } return(returntxt); }
public int UpdateLevel4(string ActivityName, string ActivityID, string Seq) { int ok = -1; MySQLConnection con = new MySQLConnection(); try { con.open(); SqlCommand cmd = new SqlCommand("usp_UpdateOrgLeve4", con.con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@OK", SqlDbType.Int); parm.Direction = ParameterDirection.Output; cmd.Parameters.AddWithValue("@Activity", ActivityName); cmd.Parameters.AddWithValue("@ActivityID", ActivityID); 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); }
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); }