文件操作 - Default.aspx.cs
返回文件管理
返回主菜单
删除本文件
文件: E:\HostingSpaces\kimblycr\monitor.kimbly.in\wwwroot\Default.aspx.cs
编辑文件内容
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { txtSDate.Text = DateTime.Today.ToShortDateString(); txtEDate.Text = DateTime.Today.ToShortDateString(); } } protected void BtnSearch_Click(object sender, EventArgs e) { SqlDataSource1.SelectParameters[0].DefaultValue = txtSDate.Text; SqlDataSource1.SelectParameters[1].DefaultValue = txtEDate.Text; GridView1.DataBind(); lblTotal.Text = SelectClass.getTotalTimeSpentBetweenDate(Convert.ToDateTime(txtSDate.Text), Convert.ToDateTime(txtEDate.Text)); if (lblTotal.Text != "") { string Hour = lblTotal.Text.Substring(0, lblTotal.Text.IndexOf(':')); string Minutes = lblTotal.Text.Substring(lblTotal.Text.IndexOf(':') + 1, lblTotal.Text.LastIndexOf(':') - lblTotal.Text.IndexOf(':') - 1); string Seconds = lblTotal.Text.Substring(lblTotal.Text.LastIndexOf(':') + 1); decimal dtm = (Convert.ToDecimal(Hour) * 272) + (Convert.ToDecimal(Minutes)*272/60) + ((Convert.ToDecimal(Seconds)/60) * (272/60)); //decimal dtm = Convert.ToDecimal(lblTotal.Text.Replace(":", ".")); string Amount = Convert.ToString(dtm) + "000"; lblAmount.Text = "Rs:" + Amount.Substring(0, Amount.IndexOf('.') + 3); } } protected void pay_Click(object sender, EventArgs e) { InsertClass.InsertPayment(DateTime.Today, txtRem.Text, 1, Convert.ToDecimal(TxtAmt.Text)); int key = 0; string pids = ""; for (int i = 0; i < GridView1.DataKeys.Count; i++) { if (pids != "") { pids += ","; } key = Convert.ToInt32(GridView1.DataKeys[i].Value); pids += key.ToString(); } UpdateClass.UpdatePayment(pids); GridView1.DataBind(); } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件