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
selvakumar karthikeyan
NA
67
1.3k
I am working in asp.net 4.0, i have an trouble to convert my application on n tire architecture, using sql transaction methods
Oct 4 2012 8:46 AM
protected void btnSubmit_Click(object sender, EventArgs e)
{
SqlTransaction trans = null;
try
{
JobOrderBL bl = new JobOrderBL();
if (btnSubmit.Text == "SUBMIT")
{
DataTable dt = (DataTable)Session["temp"];
DataRow[] rows = dt.Select();
bl.JobOrderDate = Convert.ToDateTime(dpDate.SelectedDate.ToString());
bl.JobApprovalID = Convert.ToInt64(ddlJobApprovalNO.SelectedValue.ToString());
bl.Remarks = txtRemarks.Text;
Int64 masterID = bl.CreateMaster(trans);
for (int index = 0; index < dt.Rows.Count; index++)
{
String QTY = Convert.ToString(dt.Rows[index]["OrderingQTY"].ToString());
if (QTY.ToString().Length <= 0)
{
continue;
}
bl.JOMasID = Convert.ToInt64(masterID.ToString());
bl.JobItemName = Convert.ToString(dt.Rows[index]["JobItemName"]);
bl.QTY = Convert.ToDouble(QTY);
bl.Rate = Convert.ToDecimal(dt.Rows[index]["Rate"].ToString());
bl.CreateDetails(trans);
}
}
else
{
bl.JOMasID = Convert.ToInt64(txtJOMasID.Text);
bl.JobApprovalID = Convert.ToInt64(ddlJobApprovalNO.SelectedValue.ToString());
bl.JobOrderDate = Convert.ToDateTime(dpDate.SelectedDate.ToString());
bl.Remarks = txtRemarks.Text;
bl.UpdateMaster();
Response.Redirect("JobOrder.aspx");
}
trans.Commit();
}
catch (Exception ex)
{
if (trans != null)
trans.Rollback();
lblMessage.Text=Convert.ToString(ex);
}
}
Reply
Answers (
0
)
display unicode character
Process Class in C#