public int updatePRatio(XObjs.PRatio f) { SqlConnection connection = new SqlConnection(hf.ConnectXpay()); SqlCommand command = new SqlCommand("UPDATE p_ratio SET xpartnerID='" + f.xpartnerID + "',p_type='" + f.p_type + "',xratio='" + f.xratio + "',r_type='" + f.r_type + "' WHERE xid='" + f.xid + "' ", connection); connection.Open(); int num = command.ExecuteNonQuery(); connection.Close(); return(num); }
public int addPRatio(XObjs.PRatio x) { SqlConnection connection = new SqlConnection(hf.ConnectXpay()); SqlCommand command = new SqlCommand("INSERT INTO p_ratio (xpartnerID,p_type,xratio,r_type,xreg_date,xvisible,xsync) VALUES ('" + x.xpartnerID + "','" + x.p_type + "','" + x.xratio + "','" + x.r_type + "','" + x.xreg_date + "','" + x.xvisible + "','" + x.xsync + "') SELECT SCOPE_IDENTITY()", connection); connection.Open(); int num = Convert.ToInt32(command.ExecuteScalar()); connection.Close(); return(num); }