using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; /// <summary> /// Summary description for Payment /// </summary> public class Payment { public Payment() { // // TODO: Add constructor logic here // } public DataTable GetAll(string Path) { DataTable dt = new DataTable(); DataSet ds = new DataSet(); ds.ReadXml(Path + ""); DataTable dt_ret = ds.Tables[0]; return dt_ret; } public DataTable GetByOpNo(string OpNo, string Path) { DataSet ds = new DataSet(); DataTable dt = new DataTable(); ds.ReadXml(Path); DataTable dt_ret = ds.Tables[0]; int b = 0; //INSTANT C# NOTE: The ending condition of VB 'For' loops is tested only on entry to the loop. Instant C# has created a temporary variable in order to use the initial value of dt_ret.Rows.Count for every iteration: int tempFor1 = dt_ret.Rows.Count; for (b = 0; b < tempFor1; b++) { if (OpNo.ToString().ToUpper().ToString() == dt_ret.Rows[b]["OpNo"].ToString().ToUpper().ToString()) { DataRow dr = null; dt.Columns.Add("ID"); dt.Columns.Add("OpNo"); dt.Columns.Add("Date"); dt.Columns.Add("Name"); dt.Columns.Add("TotalAmount"); dt.Columns.Add("PaidAmount"); dt.Columns.Add("BalanceAmount"); dr = dt.NewRow(); dr["ID"] = dt_ret.Rows[b]["ID"]; dr["OpNo"] = dt_ret.Rows[b]["OpNo"].ToString().ToUpper(); dr["Date"] = dt_ret.Rows[b]["Date"]; dr["Name"] = dt_ret.Rows[b]["Name"]; dr["TotalAmount"] = dt_ret.Rows[b]["TotalAmount"]; dr["PaidAmount"] = dt_ret.Rows[b]["PaidAmount"]; dr["BalanceAmount"] = dt_ret.Rows[b]["BalanceAmount"]; dt.Rows.Add(dr); return dt; } } return dt; } public long Update(string OpNo, string Date, string Name, Double TotalAmount, Double PaidAmount, Double BalanceAmount, string Path) { try { DataSet ds = new DataSet(); ds.ReadXml(Path + "/Amount.xml");
nivasinfotech
Posts
-
Reading Data from XML -
Reading Data from XML// ASCX file using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class PresentationLayer_Controls_ManagePaymentDetailsControl : System.Web.UI.UserControl { Payment ObjXMLData = new Payment(); public static int editstatus =0; protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { Session["update"] = Server.UrlEncode(System.DateTime.Now.ToString()); // to avoid page refresh problem //string opno = "0p005"; //txtOpno.Text = opno; txtDate.Text = ObjXMLData.ConvertDate(DateTime.Today.Date.ToString().Substring(0, 10)); txtDate.Text = txtDate.Text.Substring(3, 2) + "/" + txtDate.Text.Substring(0, 2) + "/" + txtDate.Text.Substring(6, 4); try { //GetData(opno, Server.MapPath("Amount.xml").ToString()); BindGrid(); } catch (Exception ex) { lbl_Error.Text = ex.Message; } } } catch (Exception ex) { string s = ex.Message; } } public void GetData(string opno, string path,int estatus) { try { DataSet ds; DataTable dt = ObjXMLData.GetByOpNo(opno, path); if (dt.Columns.Count > 0) { if (estatus == 1) { txtOpno.Text = dt.Rows[0].Table.Rows[0]["OpNo"].ToString(); txtName.Text = dt.Rows[0].Table.Rows[0]["Name"].ToString(); txtPaidAmount.Text = dt.Rows[0].Table.Rows[0]["PaidAmount"].ToString(); txtTotalAmount.Text = dt.Rows[0].Table.Rows[0]["TotalAmount"].ToString(); txtBalanceAmount.Text = dt.Rows[0].Table.Rows[0]["BalanceAmount"].ToString(); } else { txtOpno.Text = dt.Rows[0].Table.Rows[0]["OpNo"].ToString(); txtName.Text = dt.Rows[0].Table.Rows[0]["Name"].ToString(); //txtPaidAmount.Text = dt.Rows[0].Table.Rows[0]["PaidAmount"].ToString(); //txtTot
-
About Sharepoint server2007can i integrate perforce with sharepoint server2007,if any one knows kindly help me.... srinivas
-
disable print screen button in key boardhow to disable print screen using c++.i tried but i can't get answer.So please give if you know how to disable print screen using in windows operating system
srinivas
-
hi [modified]I need the code for the Login Page in .net 2005 using C# for User Login Form. i need it urgently,plzzzz ss -- modified at 4:15 Tuesday 21st November, 2006
-
Datagrid Problemwe can access any button in datagrid by using this code . you have to write this code if u want first row ,specify '0' in Items[0] Instead of zero u can specify any row number Button btn = (Button) datagridname.Items[0].FindControl("buttonname"); you can get the button text by using " btn.Text ". Response.Write(btn.Text);
srinivas
-
uploading excel file to web serveri m facing problem when uploading excel file from my local system to web server.can any one plz give me solution this problem. Thank you
srinivas
-
Refresh time for every second on the web page without using META Tag [modified]i am using Meta tag the whole page is refreshing. but i want to the to refresh label ctrl only,Any one help me for this.. srinivas -- modified at 6:46 Monday 22nd May, 2006
-
retrive the file from database.uploading the file to the database is working but i can't able to retrive the data from the database can any one give me suggetion how to retrive the data srinivas -- modified at 6:33 Friday 19th May, 2006
-
how to display selected items of a listbox into a datagrid at runtimeHi Thanks for your suggestion but i need to get at runtime, this case i m not getting it. Regards, Naren. narendra
-
pls reply immediately--------validation------ how can i set numeric only for the textbox(with out entering any character). srinivas
-
pls reply immediatelyiam selecting a excel file from dropdownlist,i want to display the excel file content in excel sheet,how can i, pls send me the code..... srinivas
-
pls reply immediatelyiam selecting a text file from dropdownlist,then i want to display the text file content in notepad,how can i, pls send me the code..... srinivas