protected void Page_Load(object sender, EventArgs e) { DateTime sd = DateTime.Now; DateTime ed; try { if (!Page.IsPostBack) { CtlAgreementPercent111.NotDefaultAgree = true; CtlAgreementPercent111.AgreementID = Convert.ToInt32(Request.QueryString["aid"]); CtlAgreementPercent111.onlyActive = 0; CtlAgreementPercent111.BindDD(); CtlAgreementPercent111.BindGrid(); CtlAgreementPercent111.NotDefaultAgree = true; } CtlAgreementPercent111.Bindtbljarime(); } catch (Exception ex) { ed = DateTime.Now; var lineNumber = new System.Diagnostics.StackTrace(ex, true).GetFrame(0).GetFileLineNumber(); clError cl = new clError(); cl.ErrorLog = ex.Message.ToString(); cl.Page = HttpContext.Current.Request.Url.OriginalString; cl.timeLeft = (ed - sd).TotalSeconds.ToString(); cl.IP = CSharp.PublicFunction.GetIPAddress(); ErrorDAL.insert(cl); } }
public void BindGrid() { DateTime sd = DateTime.Now; DateTime ed; try { ClAgreementPercent cl = new ClAgreementPercent(); cl.AgreementID = Convert.ToInt32(AgreementID); cl.ExplainID = DDExplainID.SelectedValue; cl.VisitDate = DateConvert.sh2m(txtdatetimenow.Text).ToString(); DataSet ds = AgreementPercentClass.GetList_inmonth(cl); DataView dv = new DataView(ds.Tables[0]); if (ViewState["AgreementPercentID"] == null) { ViewState["AgreementPercentID"] = "AgreementPercentID Desc"; } dv.Sort = Securenamespace.SecureData.CheckSecurity(ViewState["AgreementPercentID"].ToString()).ToString(); GridView1.DataSource = dv; GridView1.DataBind(); txtunitNumberNazer.Text = unitNumberDEfault(Convert.ToInt32(AgreementID), Convert.ToInt32(DDExplainID.SelectedValue)).ToString(); LBLunitNumberNazer.Text = unitNumberDEfault(Convert.ToInt32(AgreementID), Convert.ToInt32(DDExplainID.SelectedValue)).ToString(); RowColor(); ds.Dispose(); } catch (Exception ex) { ed = DateTime.Now; var lineNumber = new System.Diagnostics.StackTrace(ex, true).GetFrame(0).GetFileLineNumber(); clError cl = new clError(); cl.ErrorLog = ex.Message.ToString(); cl.Page = HttpContext.Current.Request.Url.OriginalString; cl.timeLeft = (ed - sd).TotalSeconds.ToString(); cl.IP = CSharp.PublicFunction.GetIPAddress(); ErrorDAL.insert(cl); } }
public void BindDD() { DateTime sd = DateTime.Now; DateTime ed; try { ClAgreement cl = new ClAgreement(); DDAgreementID.DataSource = AgreementClass.GetList(cl); DDAgreementID.DataTextField = "AgreeName"; DDAgreementID.DataValueField = "AgreementID"; DDAgreementID.DataBind(); DDSuperVisorID.DataSource = TaxiDAL.UsersClass.GetListNazer(null, null, null, null, null, null, "600", null, null, null, null); DDSuperVisorID.DataTextField = "FullNameUser"; DDSuperVisorID.DataValueField = "UserID"; DDSuperVisorID.DataBind(); DDExplainID.Bind(); CtlAgreePercentProtest1.BindDD(); Bindtbljarime(); DDExplainID.AutoPostBackExplan = true; } catch (Exception ex) { ed = DateTime.Now; var lineNumber = new System.Diagnostics.StackTrace(ex, true).GetFrame(0).GetFileLineNumber(); clError cl = new clError(); cl.ErrorLog = ex.Message.ToString(); cl.Page = HttpContext.Current.Request.Url.OriginalString; cl.timeLeft = (ed - sd).TotalSeconds.ToString(); cl.IP = CSharp.PublicFunction.GetIPAddress(); ErrorDAL.insert(cl); } }
protected void Application_Error(object sender, EventArgs e) { HttpException lastErrorWrapper = Server.GetLastError() as HttpException; Exception lastError = lastErrorWrapper; if (lastErrorWrapper.InnerException != null) { lastError = lastErrorWrapper.InnerException; } string lastErrorTypeName = lastError.GetType().ToString(); string lastErrorMessage = lastError.Message; string lastErrorStackTrace = lastError.StackTrace; string page = HttpContext.Current.Request.Url.OriginalString; clError cl = new clError(); cl.ErrorLog = lastErrorMessage + ":Type:" + lastErrorTypeName + ":ST:" + lastErrorStackTrace; cl.Page = page; cl.IP = CSharp.PublicFunction.GetIPAddress(); //string sql = " insert into Tbl_ErrorLog(ErrorLog,createDate)values(N'" + "pagr:" + page + Securenamespace.SecureData.CheckSecurity(lastErrorMessage.ToString() + "IP" + CSharp.PublicFunction.GetIPAddress().ToString()) + "',getdate())"; //System.Data.SqlClient.SqlConnection cnn = new System.Data.SqlClient.SqlConnection(CSharp.PublicFunction.cnstr()); //System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand(sql, cnn); //cmd.CommandType = System.Data.CommandType.Text; try { int i = ErrorDAL.insert(cl); //cnn.Open(); //cmd.ExecuteNonQuery(); } catch { } finally { } //// Response.Redirect("~/ErrorPage.aspx"); }