TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
John Hammond
NA
16
8.9k
Writing a testcase to Add a new group and update an existing
Oct 8 2014 12:36 PM
How do i write a testcase to the below info thanks John.
public static bool Update(Group Obj)
{
bool results = true;
string sqlStr = String.Empty;
DataSet data = new DataSet();
int count = 0;
sqlStr = "SELECT COUNT(*) ROW_COUNT FROM GRP where GRP_ID = " + "'" + Obj.GroupId + "'";
ODP_DataClient service = new ODP_DataClient();
string dbConn = GetConnData();
data = service.GetDataSet(dbConn, sqlStr);
if (data.Tables[0].Rows.Count > 0)
{
DataRow row = data.Tables[0].Rows[0];
count = Convert.ToInt32(row["ROW_COUNT"]);
}
if (count.Equals(0))
{
sqlStr = "INSERT INTO GRP (GRP_ID, GRP_NAME,GRP_WORK_LOC, GRP_UPD_USR_ID, GRP_UPD_DATETIME)";
sqlStr = sqlStr + " VALUES(" + "'" + Obj.GroupId + "'," + "'" + Obj.GroupName + "'," + "'" + Obj.WorkLocation + "','" + Obj.UpdateUserId + "', SYSDATE" + ")";
}
else
{
sqlStr = "UPDATE GRP SET GRP_NAME = '" + Obj.GroupName + "'," + " GRP_WORK_LOC = '" + Obj.WorkLocation + "', GRP_UPD_DATETIME = SYSDATE ";
sqlStr = sqlStr + " WHERE GRP_ID = '" + Obj.GroupId + "'";
}
results = service.ExecuteNonQuery(dbConn, sqlStr);
return results;
}
Reply
Answers (
0
)
combobox items is not selected while load from gird to combo
Popup window to appear on an event