public int updateFee_list(XObjs.Fee_list f) { SqlConnection connection = new SqlConnection(hf.ConnectXpay()); SqlCommand command = new SqlCommand("UPDATE fee_list SET item='" + f.item + "',item_code='" + f.item_code + "',qt_code='" + f.qt_code + "',xdesc='" + f.item + "',init_amt='" + f.init_amt + "',tech_amt='" + f.tech_amt + "',xcategory='" + f.xcategory + "',xlogstaff='" + f.xlogstaff + "',xsync='" + f.xsync + "' WHERE xid='" + f.xid + "' ", connection); connection.Open(); int num = command.ExecuteNonQuery(); connection.Close(); return(num); }
public int addFee_list(XObjs.Fee_list x) { SqlConnection connection = new SqlConnection(hf.ConnectXpay()); SqlCommand command = new SqlCommand("INSERT INTO fee_list (item,item_code,qt_code,xdesc,init_amt,tech_amt,xcategory,xlogstaff,xreg_date,xvisible,xsync) VALUES ('" + x.item + "','" + x.item_code + "','" + x.qt_code + "','" + x.item + "','" + x.init_amt + "','" + x.tech_amt + "','" + x.xcategory + "','" + x.xlogstaff + "','" + x.xreg_date + "','" + x.xvisible + "','" + x.xsync + "') SELECT SCOPE_IDENTITY()", connection); connection.Open(); int num = Convert.ToInt32(command.ExecuteScalar()); connection.Close(); return(num); }