Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!ValidarConexionYUsuarioLogueado(sender))
            {
                return;
            }
            if (Session["connectionString"] == null || Session["USER"] == null)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "Logoff", "LogOff();", true);
            }
            if (!Page.IsPostBack)
            {
                DateInicio.Date            = DateTime.Today;
                DateFin.Date               = DateTime.Today;
                Session["DsErpSendStatus"] = null;
                GetErpSendStatus(DateFin.Date, DateInicio.Date);
            }

            if (Session["DsErpSendStatus"] != null)
            {
                try
                {
                    var ds = (DataSet)Session["DsErpSendStatus"];
                    GridErpSs.DataSource = ds;
                    var regionCombo = (GridErpSs.Columns["TXN_TYPE"] as GridViewDataComboBoxColumn);
                    if (regionCombo != null)
                    {
                        regionCombo.PropertiesComboBox.DataSource = ds.Tables[0].DefaultView.ToTable(true, "TXN_TYPE");
                        regionCombo.PropertiesComboBox.ValueField = "TXN_TYPE";
                        regionCombo.PropertiesComboBox.TextField  = "TXN_TYPE";
                    }
                    var regionCombo2 = (GridErpSs.Columns["PROVIDER/CUSTOMER"] as GridViewDataComboBoxColumn);
                    if (regionCombo2 != null)
                    {
                        regionCombo2.PropertiesComboBox.DataSource = ds.Tables[0].DefaultView.ToTable(true, "PROVIDER/CUSTOMER");
                        regionCombo2.PropertiesComboBox.ValueField = "PROVIDER/CUSTOMER";
                        regionCombo2.PropertiesComboBox.TextField  = "PROVIDER/CUSTOMER";
                    }
                    GridErpSs.DataBind();
                    ReportView();
                }
                catch (Exception ex)
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + ex.Message + "');", true);
                }
            }
            else
            {
                GetErpSendStatus(DateFin.Date, DateInicio.Date);
            }
        }
Esempio n. 2
0
 public void GetErpSendStatus(DateTime fechaInicio, DateTime fechaFin)
 {
     try
     {
         var pResult = "";
         var ds      = _objTxn.GetErpSendStatus(Session["connectionString"].ToString(), fechaInicio, fechaFin, ref pResult);
         if (pResult == "")
         {
             GridErpSs.DataSource = ds;
             var regionCombo = (GridErpSs.Columns["TXN_TYPE"] as GridViewDataComboBoxColumn);
             if (regionCombo != null)
             {
                 regionCombo.PropertiesComboBox.DataSource = ds.Tables[0].DefaultView.ToTable(true, "TXN_TYPE");
                 regionCombo.PropertiesComboBox.ValueField = "TXN_TYPE";
                 regionCombo.PropertiesComboBox.TextField  = "TXN_TYPE";
             }
             var regionCombo2 = (GridErpSs.Columns["PROVIDER/CUSTOMER"] as GridViewDataComboBoxColumn);
             if (regionCombo2 != null)
             {
                 regionCombo2.PropertiesComboBox.DataSource = ds.Tables[0].DefaultView.ToTable(true, "PROVIDER/CUSTOMER");
                 regionCombo2.PropertiesComboBox.ValueField = "PROVIDER/CUSTOMER";
                 regionCombo2.PropertiesComboBox.TextField  = "PROVIDER/CUSTOMER";
             }
             GridErpSs.DataBind();
             Session["DsErpSendStatus"] = ds;
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true);
         }
     }
     catch (Exception ex)
     {
         GridErpSs.JSProperties.Add("cpError", ex.Message);
         ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + ex.Message + "');", true);
     }
 }