<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/EuroFlexMaster.master" Title="Remarks Master" Theme="Flex" CodeFile="Remarks_Master.aspx.cs" Inherits="GRNMaster_Remarks_Master" %> <div id="Dia Master"> <fieldset style="width: 90%; height: 95%;"> <legend style="width: 130px; text-align: center; color: #9900ff; font-size: 14px;">New Remarks</legend> <table border="0" style="height: 90%; width: 111%"> <tr style="height: 25px"> <td colspan="5"></td> </tr> <tr> <td style="width: 25%; height: 92px;"></td> <td style="width: 9%; height: 92px;"> <label id="lblRemarks">Remarks</label> </td> <td style="height: 92px; width: 25%;"> <asp:TextBox runat="server" ID="txtRemarks" TextMode="MultiLine" MaxLength="240" Width="100%" Height="100%"></asp:TextBox><br /> </td> <td style="width: 12%; height: 92px;"> <asp:RequiredFieldValidator ID="ReqRemarks" runat="server" ForeColor="Red" ControlToValidate="txtRemarks" ErrorMessage="Enter Remarks" SetFocusOnError="true" Display="Dynamic" Text="*"></asp:RequiredFieldValidator> </td> <td style="width: 217px; height: 92px;"></td> </tr> <tr> <td style="height: 25px; width: 25%;"></td> <td style="height: 25px; width: 9%;"></td> <td valign="top" align="right" style="height: 25px; width: 25%;"></td> <td valign="top" align="right" style="height: 25px; width: 12%;"> </td> <td style="height: 25px; width: 217px;"></td> </tr> <tr> <td style="height: 25px; width: 25%;"> </td> <td style="height: 25px; width: 9%;"></td> <td valign="top" align="right" style="height: 25px; width: 25%;"> <center> <asp:Button runat="server" ID="btnRemarksView" Text="View All" OnClick="btnRemarksView_Click" CausesValidation="false" /> <span> </span> <asp:Button runat="server" ID="btnSave" Text="Save" OnClick="btnSave_Click1" CausesValidation="true"/> <span> </span> <asp:Button runat="server" ID="Clear" Text="Clear" OnClick="Clear_Click" CausesValidation="false" /> <span> </span> </center> </td> </tr> </table> </fieldset> </div>
using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class GRNMaster_Remarks_Master : System.Web.UI.Page { protected void Clear_Click(object sender, EventArgs e) { txtRemarks.Text = ""; remarkView.Visible = false; } protected void btnSave_Click1(object sender, EventArgs e) { MyDBmgr = new MySqlDBMgr(); //Declaring New Instance of DataBase Object string cmd = string.Empty; //String Declaration for DataBase Query string cmdInsert = string.Empty; //String Declaration for DataBase Query cmdInsert = "insert into euroflexworkflow.remarksmaster(RemarkName) Values('" + txtRemarks.Text + "')"; MyDBmgr.RunSqlCommand(cmdInsert, true); //Passing Query to method which Executes query FlexUtilities.ShowAlert(this, " Record Inserted Successfully"); txtRemarks.Text = ""; } protected void btnRemarksView_Click(object sender, EventArgs e) { Rebind(); } protected void Rebind() { MyDBmgr = new MySqlDBMgr(); //Declaring New Instance of DataBase Object DataSet RemarkDS = new DataSet(); RemarkDS = MyDBmgr.RunProcedure("getremarksdetails"); remarkView.DataSource = RemarkDS.Tables[0].DefaultView; remarkView.DataBind(); remarkView.Visible = true; Session["myDataset"] = RemarkDS; trGrdCount.Visible = true; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)