private void SaveDataFotblMaintenancePlanDate() { DataTable DTLocal = null; DataView DVLocal = null; DataRow DRLocal = null; System.Web.UI.Page this_page_ref = null; string strSQL = null; try { DTLocal = new DataTable(); DVLocal = new DataView(); for (int i = 0; i < grdEdit.Rows.Count; i++) { //strSQL = "Select * from tblMaintenancePlanDate where MPDCode = '" + txtMPDCode.Text.Trim() + "'"; strSQL = "Select * from tblMaintenancePlanDate where MPCode = '" + txtMPCode.Text.Trim() + "'"; ConManager.DBConnection("TERMSMNT"); ConManager.OpenDataTableThroughAdapter(strSQL, out DTLocal, true); DTLocal.TableName = "MaintenanceDates"; DVLocal.Table = DTLocal; if (DVLocal.Count == 0) { NewMPDateCode(); DRLocal = DTLocal.NewRow(); DRLocal["MPDCode"] = txtMPDCode.Text.Trim(); DRLocal["SheduleDate"] = Convert.ToDateTime(grdEdit.Rows[i].Cells[1].Text); DRLocal["MPCode"] = Session["USER"].ToString().Trim(); DRLocal["Remarks"] = ""; DTLocal.Rows.Add(DRLocal); txtMPDCode.Text = ""; } else { DRLocal = DVLocal[0].Row; DRLocal.BeginEdit(); if (txtSheduleDate.Text != "") DRLocal["SheduleDate"] = Convert.ToDateTime(txtSheduleDate.Text.Trim()); if (txtRemark.Text != "") DRLocal["Remarks"] = txtRemark.Text.Trim(); if (txtMPDCode.Text != "") DRLocal["MPDCode"] = txtMaintenanceSheduleCode.Text.Trim(); DRLocal["MPCode"] = txtMPCode.Text.Trim(); DRLocal.EndEdit(); } ConManager.DBConnection("TERMSMNT"); ConManager.BeginTransaction(); ConManager.SaveDataTableThroughAdapter(ref DTLocal, true); ConManager.CommitTransaction(); } } catch (Exception ex) { throw ex; } finally { ConManager.CloseConnection(); } }
string str = Server.HtmlDecode(txtRemark.Text); //OR string str = Server.HtmlEncode(txtRemark.Text);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)