public DataTable LoadReport()
 {
     try
     {
         string Query =
             string.Format(@"EXECUTE sp_rptFinancialParcelOfFirstState
                    @FirstState={0},@FirstCity={1},@FirstPostNode={2}
                   ,@LastState={3},@LastCity={4},@LastPostNode={5}
                   ,@FirstDate='{6}',@LastDate='{7}',@PayType={8},@BarcodeStatus={9}",
                           _host.ddlState.SelectedValue
                           , _host.ddlCity.SelectedValue
                           , _host.ddlPostNode.SelectedValue
                           , _host.ddlLastState.SelectedValue
                           , _host.ddlLastCity.SelectedValue
                           , _host.ddlLastPostNode.SelectedValue
                           , _host.Fdate
                           , _host.Ldate
                           , _host.ddlCredit.SelectedValue
                           , _host.ddlBarcodeStatus.SelectedValue);
         return(exe.SqlDataTable(Query));
     }
     catch (Exception ex)
     {
         string Query = string.Format(@"EXECUTE sp_FilltblErrorProgrammer
                                @Message=N'{0}'
                               ,@DateError='{1}'
                               ,@PhysicalPath=N'{2}'
                               ,@UserHostAddress='{3}'
                               ,@Browser='{4}'"
                                      , "Error For Load Report :  rptBarcodeDetail ; Detail :  " + ex.Message.Replace("'", "''")
                                      , DateAndTime.GetDateTime16Digit_Latin(), "", "", "");
         return(exe.SqlDataTable(Query));
     }
 }
Ejemplo n.º 2
0
 public DataSet LoadReport()
 {
     try
     {
         string Query =
             string.Format(@"EXECUTE sp_rptCountDebitForState
                    @FirstState={0},@FirstCity={1},@FirstPostNode={2}
                   ,@LastState={3},@Date1='{4}',@Date2='{5}',@StatusID='{6}',@IsReceipt={7}
                   ,@LastCity={8},@LastPostNode={9}",
                           _host.ddlState.SelectedValue
                           , _host.ddlCity.SelectedValue
                           , _host.ddlPostNode.SelectedValue
                           , _host.ddlLastState.SelectedValue
                           , _host.Fdate
                           , _host.Ldate
                           , _host.hfStateList.Value
                           , _host.ddlIsReceipt.SelectedValue
                           , _host.ddlLastCity.SelectedValue
                           , _host.ddlLastPostNode.SelectedValue);
         return(exe.SqlDataSet(Query));
     }
     catch (Exception ex)
     {
         string Query = string.Format(@"EXECUTE sp_FilltblErrorProgrammer
                                @Message=N'{0}'
                               ,@DateError='{1}'
                               ,@PhysicalPath=N'{2}'
                               ,@UserHostAddress='{3}'
                               ,@Browser='{4}'"
                                      , "Error For Load Report :  rptCountDebitForState ; Detail :  " + ex.Message.Replace("'", "''")
                                      , DateAndTime.GetDateTime16Digit_Latin(), "", "", "");
         return(exe.SqlDataSet(Query));
     }
 }
Ejemplo n.º 3
0
        public void SaveLogError(Exception e, string ctlName, HttpServerUtility Server)
        {
            try
            {
                string Query = string.Format(@"EXECUTE sp_FilltblErrorProgrammer
                                       @Message=N'{0}'
                                      ,@DateError='{1}'
                                      ,@PhysicalPath=N'{2}'
                                      ,@UserHostAddress='{3}'
                                      ,@Browser='{4}'"
                                             , e.Message.Replace("'", "")
                                             , DateAndTime.GetDateTime16Digit_Latin()
                                             , ctlName
                                             , "", "");
                db.SqlExecute(Query);
            }
            catch
            {
                string strErrorMessage =
                    string.Format
                    (
                        "{0} Time: {1:yyyy/MM/dd - HH:mm:ss}, Path: {2}, User IP: {3}",
                        e.Message,
                        System.DateTime.Now,
                        ctlName,
                        ""
                    );

                System.IO.StreamWriter oStream = null;

                try
                {
                    string strApplicationLogRootRelativePathName =
                        "~/App_Data/Logs/Application.log";

                    string strApplicationLogPathName =
                        Server.MapPath(strApplicationLogRootRelativePathName);

                    lock (this)
                    {
                        oStream =
                            new System.IO.StreamWriter
                                (strApplicationLogPathName, true, System.Text.Encoding.UTF8);

                        oStream.WriteLine(strErrorMessage);
                    }
                }
                catch
                {
                }
                finally
                {
                    if (oStream != null)
                    {
                        oStream.Dispose();
                        oStream = null;
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public DataTable LoadReport()
        {
            DataTable dt = new DataTable();

            try
            {
                string Query =
                    string.Format(@"EXECUTE sp_rptStateIncomingParcels
                                               @fDate='{0}'  ,@lDate='{1}'  ,@LastStateCode={2}  ,@LastCityCode={3}  
                                               ,@LastPostNode={4},@FirstStateCode={5}  ,@ReceiptState='{6}'  ,@ExchangeState={7}
                                               ,@ServiceType={8} ,@IsContract='{9}'  ,@GContractID={10}  ,@RoleID={11}",
                                  _host.Fdate, _host.Ldate, _host.ddlLastState.SelectedValue, _host.ddlLastCity.SelectedValue
                                  , _host.ddlLastPostNode.SelectedValue, _host.ddlFirstState.SelectedValue, _host.ddlReceiptState.SelectedValue
                                  , _host.ddlExchangeState.SelectedValue
                                  , _host.ddlServiceType.SelectedValue, _host.ddlContractType.SelectedValue, _host.ddlGC.SelectedValue, UserInfo.RoleID);
                dt = exe.SqlDataTable(Query);
                return(dt);
            }
            catch (Exception ex)
            {
                string Query = string.Format(@"EXECUTE sp_FilltblErrorProgrammer
                                       @Message=N'{0}'
                                      ,@DateError='{1}'
                                      ,@PhysicalPath=N'{2}'
                                      ,@UserHostAddress='{3}'
                                      ,@Browser='{4}'"
                                             , "Error For Load Report :  rptCountDebitForState ; Detail :  " + ex.Message.Replace("'", "''")
                                             , DateAndTime.GetDateTime16Digit_Latin(), "", "", "");
                exe.SqlDataSet(Query);
                return(dt);
            }
        }
        private void LoadReport()
        {
            try
            {
                string Query =
                    string.Format(@"EXECUTE sp_rptBarcodeDetail
                    @UserID={0},@fDate='{1}',@lDate='{2}',@StateCode={3}
                    ,@CityCode={4},@PostNode={5},@StatusID={6}"
                                  , param.UserID, param.FirstDate, param.LastDate, param.StateCode
                                  , param.CityCode, param.PostNodeCode, param.BarcodeStatusID);
                dtReport = _host.SqlDataTable(Query);

                //Label16.Text = "(از تاریخ : " + param.FirstDate + "            تا تاریخ:" +param.LastDate + ")";
            }
            catch (Exception ex)
            {
                string Query = string.Format(@"EXECUTE sp_FilltblErrorProgrammer
                                       @Message=N'{0}'
                                      ,@DateError='{1}'
                                      ,@PhysicalPath=N'{2}'
                                      ,@UserHostAddress='{3}'
                                      ,@Browser='{4}'"
                                             , "Error For Load Report :  rptBarcodeDetail ; Detail :  " + ex.Message.Replace("'", "''")
                                             , DateAndTime.GetDateTime16Digit_Latin(), "", "", "");
                _host.SqlExecute(Query);
            }
        }
Ejemplo n.º 6
0
        private void LoadReport()
        {
            try
            {
                string Query =
                    string.Format(@"EXECUTE sp_rptReceiptDetail
                                       @Fdate='{0}'
                                      ,@Ldate='{1}'
                                      ,@StateCode={2}
                                      ,@CityCode={3}
                                      ,@PostNode={4}
                                      ,@UserID={5}
                                      ,@ReceiptTypeValue={6}
                                      ,@FinancialMoodValue={7}
                                      ,@ApproveFlag='{8}'
                                      ,@IsPhish={9}"
                                  , param.FirstDate
                                  , param.LastDate
                                  , param.StateCode
                                  , param.CityCode
                                  , param.PostNodeCode
                                  , param.UserID
                                  , param.ReceiptTypeValue
                                  , param.FinancialMoodValue
                                  , param.ApproveFlag
                                  , param.PayType);

                dtReport = _host.SqlDataTable(Query);

                //_StimReport["UserName"] = UserName;
                //_StimReport["PostNodeName"] = _LoginDetails.CityName + "-" + _LoginDetails.PostNodeName;
                //_StimReport["ReportDate"] = ReportDate;
            }
            catch (Exception ex)
            {
                string Query = string.Format(@"EXECUTE sp_FilltblErrorProgrammer
                                       @Message=N'{0}'
                                      ,@DateError='{1}'
                                      ,@PhysicalPath=N'{2}'
                                      ,@UserHostAddress='{3}'
                                      ,@Browser='{4}'"
                                             , "Error For Load Report :  rptBarcodeDetail ; Detail :  " + ex.Message.Replace("'", "''")
                                             , DateAndTime.GetDateTime16Digit_Latin(), "", "", "");
                _host.SqlExecute(Query);
            }
        }
Ejemplo n.º 7
0
        private void LoadReport()
        {
            try
            {
                string Query =
                    string.Format(@"EXEC sp_Udate_GhaboolAndMobadeleh_New
		                            @Date1 = '{0}',
		                            @Date2 = '{1}',
		                            @FirstState = {2},
		                            @FirstCity = {3},
		                            @FirstPostNode = {4},
		                            @LastState = {5},
                                    @UserId = '{6}',
                                    @IsInitialize = {7}
"
                                  , param.FirstDate
                                  , param.LastDate
                                  , param.StateCode
                                  , param.CityCode
                                  , param.PostNodeCode
                                  , param.LastStateCode
                                  , _LoginDetails.ID
                                  , 1);

                dtReport = _host.SqlDataTable(Query);
                FindName(out StateName, out CityName, out PostNode_Name);
                //_StimReport["UserName"] = UserName;
                //_StimReport["PostNodeName"] = _LoginDetails.CityName + "-" + _LoginDetails.PostNodeName;
                //_StimReport["ReportDate"] = ReportDate;
            }
            catch (Exception ex)
            {
                string Query = string.Format(@"EXECUTE sp_FilltblErrorProgrammer
                                       @Message=N'{0}'
                                      ,@DateError='{1}'
                                      ,@PhysicalPath=N'{2}'
                                      ,@UserHostAddress='{3}'
                                      ,@Browser='{4}'"
                                             , "Error For Load Report :  sp_Udate_GhaboolAndMobadeleh in Total Segment ; Detail :  " + ex.Message.Replace("'", "''")
                                             , DateAndTime.GetDateTime16Digit_Latin(), "", "", "");
                _host.SqlExecute(Query);
            }
        }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                UserValidate();

                ReportObject(ANP.Data.BaseData.Library.Encryption.Decrypt(Request.QueryString["pra"].ToString()));
                string ConnectionString             = _host.ConnectionString;
                Stimulsoft.Report.StiReport _report = new StiReport();
                _report.Load(Resources.mrtFinancialParcelOfFirstState);
                _report.Dictionary.Databases.Clear();
                _report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("PofficeCOD186", ConnectionString));
                _report.Compile();

                _report["FirstState"]       = (ddlState == string.Empty ? 0 : Convert.ToInt32(ddlState));
                _report["FirstCity"]        = (ddlCity == string.Empty ? 0 : Convert.ToInt32(ddlCity));
                _report["FirstPostNode"]    = (ddlPostNode == string.Empty ? 0 : Convert.ToInt32(ddlPostNode));
                _report["LastState"]        = (ddlLastState == string.Empty ? 0 : Convert.ToInt32(ddlLastState));
                _report["LastCity"]         = (ddlLastCity == string.Empty ? 0 : Convert.ToInt32(ddlLastCity));
                _report["LastPostNode"]     = (ddlLastPostNode == string.Empty ? 0 : Convert.ToInt32(ddlLastPostNode));
                _report["FirstDate"]        = Fdate;
                _report["LastDate"]         = Ldate;
                _report["PayType"]          = (ddlCredit == string.Empty ? 0 : Convert.ToInt32(ddlCredit));
                _report["BarcodeStatus"]    = (ddlBarcodeStatus == string.Empty ? 0 : Convert.ToInt32(ddlBarcodeStatus));
                _report["BarcodeSubStatus"] = (ddlBarcodeSubStatus == string.Empty ? 0 : Convert.ToInt32(ddlBarcodeSubStatus));
                _report["UserName"]         = _LoginDetails.Pname + " " + _LoginDetails.RolePname + " از " + _LoginDetails.StateName;
                _report["ReportDate"]       = DateAndTime.GetSQLDate10DigitShamsi() + " -- " + DateAndTime.GetSQLTime8Digit();

                StiWebViewer1.Report = _report;
            }
            catch (Exception ex)
            {
                string Query = string.Format(@"EXECUTE sp_FilltblErrorProgrammer
                                       @Message=N'{0}'
                                      ,@DateError='{1}'
                                      ,@PhysicalPath=N'{2}'
                                      ,@UserHostAddress='{3}'
                                      ,@Browser='{4}'"
                                             , "Error For Load Report :  rptFinancialParcelOfFirstState ; Detail :  " + ex.Message.Replace("'", "''")
                                             , DateAndTime.GetDateTime16Digit_Latin(), "", "", "");
                _host.SqlExecute(Query);
            }
        }
Ejemplo n.º 9
0
        private DataTable LoadReportDetail()
        {
            try
            {
                string Query =
                    string.Format(@"EXEC sp_Udate_GhaboolAndMobadeleh_New
		                            @Date1 = '{0}',
		                            @Date2 = '{1}',
		                            @FirstState = {2},
		                            @FirstCity = {3},
		                            @FirstPostNode = {4},
		                            @LastState = {5},
                                    @UserId = '{6}',
                                    @IsInitialize = {7}
"
                                  , param.FirstDate
                                  , param.LastDate
                                  , param.StateCode
                                  , param.CityCode
                                  , param.PostNodeCode
                                  , param.LastStateCode
                                  , _LoginDetails.ID
                                  , 2);

                return(_host.SqlDataTable(Query));
            }
            catch (Exception ex)
            {
                string Query = string.Format(@"EXECUTE sp_FilltblErrorProgrammer
                                       @Message=N'{0}'
                                      ,@DateError='{1}'
                                      ,@PhysicalPath=N'{2}'
                                      ,@UserHostAddress='{3}'
                                      ,@Browser='{4}'"
                                             , "Error For Load Report :  sp_Udate_GhaboolAndMobadeleh  in Detail Segment ; Detail :  " + ex.Message.Replace("'", "''")
                                             , DateAndTime.GetDateTime16Digit_Latin(), "", "", "");
                _host.SqlExecute(Query);
                return(new DataTable());
            }
        }
Ejemplo n.º 10
0
        private void LoadReport()
        {
            try
            {
                string Query =
                    string.Format(@"EXECUTE  sp_rptOneBarCodeDetail
                                   @RoleID={0}
                                  ,@StateCode={1}
                                  ,@CityCode={2}
                                  ,@PostNode={3}
                                  ,@BarCode='{4}'
                                  ,@UserID={5}",

                                  _LoginDetails.RoleID,
                                  _LoginDetails.StateCode,
                                  _LoginDetails.CityCode,
                                  _LoginDetails.PostNodeCode,
                                  param.BarCode,
                                  _LoginDetails.UserId);

                dtReport = _host.SqlDataTable(Query);

                IsDeleted = dtReport.Rows[0]["IsDeleted"].ToString();
                //_StimReport["UserName"] = UserName;
                //_StimReport["PostNodeName"] = _LoginDetails.CityName + "-" + _LoginDetails.PostNodeName;
                //_StimReport["ReportDate"] = ReportDate;
            }
            catch (Exception ex)
            {
                string Query = string.Format(@"EXECUTE sp_FilltblErrorProgrammer
                                       @Message=N'{0}'
                                      ,@DateError='{1}'
                                      ,@PhysicalPath=N'{2}'
                                      ,@UserHostAddress='{3}'
                                      ,@Browser='{4}'"
                                             , "Error For Load Report :  rptBarcodeDetail ; Detail :  " + ex.Message.Replace("'", "''")
                                             , DateAndTime.GetDateTime16Digit_Latin(), "", "", "");
                _host.SqlExecute(Query);
            }
        }
Ejemplo n.º 11
0
        protected void btn_login_Click(object sender, EventArgs e)
        {
            lbl_msg.Text = string.Empty;
            string Query   = "";
            string Message = string.Format("userName= {0} , Pass= {1} , Date= {2} , IP= {3} , Browser= {4}", txt_UserName.Text, txt_Password.Text
                                           , DateAndTime.GetDateTime16Digit(), Request.UserHostAddress, Request.Browser.Browser);

            Query = string.Format(@"insert INTO tblLog ( Title,Detail ) VALUES (N'{0}',N'{1}')", "صفحه ورود ", Message.Replace("'", ""));
            Utility.RunQuery(Query);
            if (Request.UserHostAddress.Replace("'", "") == "10.1.1.52" || Request.UserHostAddress == "10.1.1.52")
            {
                Query = string.Format(@"EXECUTE sp_FilltblErrorProgrammer
                                       @Message=N'{0}'
                                      ,@DateError='{1}'
                                      ,@PhysicalPath=N'{2}'
                                      ,@UserHostAddress='{3}'
                                      ,@Browser='{4}'"
                                      , string.Format("userName= {0} , Pass= {1}", txt_UserName.Text, txt_Password.Text)
                                      , DateAndTime.GetDateTime16Digit_Latin()
                                      , "صفحه ورود . کاربر مشکوک سعی در ورود به نرم افزار کرد ."
                                      , Request.UserHostAddress.Replace("'", "")
                                      , Request.Browser.Browser.Replace("'", ""));
                Utility.RunQuery(Query);
                Response.Redirect("~/Wrongdoer.aspx", true);
            }

            object UserData = Logins.chkUser();

            if (UserData != null)
            {
                Session["UserInfo"] = UserData;
                lbl_msg.Text        = "";
                FillCookie(UserData);
                Response.Redirect("~/Default.aspx?action=b4c96ed1-30a8-4766-9c07-80172e0cd1dd", true);
            }
            lbl_msg.Text = "کاربر مورد نظر یافت نشد";
        }
Ejemplo n.º 12
0
        private void LoadReport()
        {
            try
            {
                string ConnectionString             = _host.ConnectionString;
                Stimulsoft.Report.StiReport _report = new StiReport();
                _report.Load(Resources.mrtBarcodeDetailes);
                _report.Dictionary.Databases.Clear();
                _report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("PofficeCOD186", ConnectionString));
                _report.Compile();

                _report["UserID"]     = (param.UserID.Trim() == string.Empty ? "0" : param.UserID.Trim());
                _report["fDate"]      = (param.FirstDate.Trim() == string.Empty ? "1500/01/01" : param.FirstDate.Trim());
                _report["lDate"]      = (param.LastDate.Trim() == string.Empty ? "1500/01/01" : param.LastDate.Trim());
                _report["StateCode"]  = (param.StateCode.Trim() == string.Empty ? 0 : Convert.ToInt32(param.LastStateCode));
                _report["CityCode"]   = (param.CityCode.Trim() == string.Empty ? 0 : Convert.ToInt32(param.CityCode));
                _report["PostNode"]   = (param.PostNodeCode.Trim() == string.Empty ? 0 : Convert.ToInt32(param.PostNodeCode));
                _report["StatusID"]   = (param.BarcodeStatusID.Trim() == string.Empty ? 0 :Convert.ToInt32(param.BarcodeStatusID));
                _report["UserName"]   = _LoginDetails.Pname + " " + _LoginDetails.RolePname + " از " + _LoginDetails.StateName;
                _report["ReportDate"] = DateAndTime.GetSQLDate10DigitShamsi() + " -- " + DateAndTime.GetSQLTime8Digit();

                StiWebViewer1.Report = _report;
            }
            catch (Exception ex)
            {
                string Query = string.Format(@"EXECUTE sp_FilltblErrorProgrammer
                                       @Message=N'{0}'
                                      ,@DateError='{1}'
                                      ,@PhysicalPath=N'{2}'
                                      ,@UserHostAddress='{3}'
                                      ,@Browser='{4}'"
                                             , "Error For Load Report :  rptBarcodeDetail ; Detail :  " + ex.Message.Replace("'", "''")
                                             , DateAndTime.GetDateTime16Digit_Latin(), "", "", "");
                _host.SqlExecute(Query);
            }
        }
Ejemplo n.º 13
0
        void Application_Error(object sender, EventArgs e)
        {
            if ((Server != null) &&
                (Server.GetLastError() != null) &&
                (Server.GetLastError().GetBaseException() != null))
            {
                System.Exception ex =
                    Server.GetLastError().GetBaseException();
                try
                {
                    string Query = string.Format(@"EXECUTE sp_FilltblErrorProgrammer
                                       @Message=N'{0}'
                                      ,@DateError='{1}'
                                      ,@PhysicalPath=N'{2}'
                                      ,@UserHostAddress='{3}'
                                      ,@Browser='{4}'"
                                                 , ex.Message.Replace("'", "")
                                                 , DateAndTime.GetDateTime16Digit_Latin()
                                                 , Request.PhysicalPath.Replace("'", "")
                                                 , Request.UserHostAddress.Replace("'", "")
                                                 , Request.Browser.Browser.Replace("'", ""));
                    Utility.RunQuery(Query);
                }
                catch
                {
                    string strErrorMessage =
                        string.Format
                        (
                            "{0} Time: {1:yyyy/MM/dd - HH:mm:ss}, Path: {2}, User IP: {3}",
                            ex.Message,
                            System.DateTime.Now,
                            Request.PhysicalPath,
                            Request.UserHostAddress
                        );
                    Application.Lock();
                    System.IO.StreamWriter oStream = null;

                    try
                    {
                        string strApplicationLogRootRelativePathName =
                            "~/App_Data/Logs/Application.log";

                        string strApplicationLogPathName =
                            Server.MapPath(strApplicationLogRootRelativePathName);

                        oStream =
                            new System.IO.StreamWriter
                                (strApplicationLogPathName, true, System.Text.Encoding.UTF8);

                        oStream.WriteLine(strErrorMessage);
                    }
                    catch
                    {
                    }
                    finally
                    {
                        if (oStream != null)
                        {
                            oStream.Dispose();
                            oStream = null;
                        }
                    }
                    Application.UnLock();
                }
            }

            Response.Redirect("~/erorr.aspx", true);
        }