public void GetAllCostumers()
 {
     try
     {
         var pResult = "";
         var ds      = _wscalled.GetAllCostumers(Session["connectionString"].ToString(), ref pResult);
         if (pResult == "")
         {
             if (ds.Tables[0].Rows.Count > 0)
             {
                 ASPxGridLookup1.DataSource = ds;
                 //ASPxGridLookup1.TextField = "NAME_CLASSIFICATION";
                 //ASPxGridLookup1.ValueField = "CLASSIFICATION";
                 ASPxGridLookup1.DataBind();
             }
             Session["CUSTOMER"] = ds;
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true);
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
     }
 }
 public void CargarOperador()
 {
     try
     {
         var objUsers = new WSUsers.SwiftExpressWSUsers();
         var pResult  = "";
         var ds       = objUsers.GetUsers(Session["connectionString"].ToString(), ref pResult);
         if (pResult == "")
         {
             if (ds.Tables[0].Rows.Count > 0)
             {
                 ASPxGridLookup1.DataSource = ds;
                 ASPxGridLookup1.DataBind();
             }
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true);
         }
         objUsers.Dispose();
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (ValidarConexionYUsuarioLogueado(sender))
     {
         try
         {
             if (!Page.IsPostBack)
             {
                 GetCustomer();
                 GetBranches();
                 GetRoute();
             }
             else
             {
                 if (Session["dsCustomerBranch"] != null)
                 {
                     ASPxGridLookup1.DataSource = Session["dsCustomerBranch"];
                     ASPxGridLookup1.DataBind();
                 }
                 else
                 {
                     GetCustomer();
                 }
                 if (Session["dsRouteBranch"] != null)
                 {
                     ASPxGridLookup2.DataSource = Session["dsRouteBranch"];
                     ASPxGridLookup2.DataBind();
                 }
                 else
                 {
                     GetRoute();
                 }
                 if (Session["dsBranch"] != null)
                 {
                     ASPxGridView1.DataSource = Session["dsBranch"];
                     ASPxGridView1.DataBind();
                     ReportView();
                 }
                 else
                 {
                     GetBranches();
                 }
             }
         }
         catch (Exception ex)
         {
             ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
         }
     }
 }
 public void GetDriver()
 {
     try
     {
         var pResult = "";
         var ds      = _wsCalled.GetAllDriver(Session["connectionString"].ToString(), ref pResult);
         if (pResult == "")
         {
             Session["DsDriver"]        = ds;
             ASPxGridLookup1.DataSource = ds;
             ASPxGridLookup1.DataBind();
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true);
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
     }
 }
Exemplo n.º 5
0
 public void GetSellers()
 {
     try
     {
         var pResult = "";
         var ds      = _objUsers.GetPresaleSellers(Session["connectionString"].ToString(), ref pResult);
         if (pResult == "")
         {
             ASPxGridLookup1.DataSource = ds;
             ASPxGridLookup1.DataBind();
             Session["SELLERS_AR"] = ds;
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true);
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
     }
 }
Exemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!ValidarConexionYUsuarioLogueado(sender))
     {
         return;
     }
     if (!Page.IsPostBack)
     {
         ASPxCalendar1.SelectedDate     = DateTime.Today;
         ASPxGridLookup1.GridView.Width = 300;
         GetCustomersByDate(ASPxCalendar1.SelectedDate);
         GetTasksByDate(ASPxCalendar1.SelectedDate);
         GetSellers();
         GetCustomers();
     }
     if (Session["CUSTOMER_AR"] != null)
     {
         ASPxGridView1.DataSource = Session["CUSTOMER_AR"];
         ASPxGridView1.DataBind();
     }
     if (Session["TASK_AR"] != null)
     {
         ASPxGridView2.DataSource = Session["TASK_AR"];
         ASPxGridView2.DataBind();
         ReportView();
     }
     if (Session["SELLERS_AR"] != null)
     {
         ASPxGridLookup1.DataSource = Session["SELLERS_AR"];
         ASPxGridLookup1.DataBind();
     }
     if (Session["ALL_CUSTOMERS_AR"] != null)
     {
         ASPxGridView3.DataSource = Session["ALL_CUSTOMERS_AR"];
         ASPxGridView3.DataBind();
     }
 }
 public void GetOperator()
 {
     try
     {
         var objIncome = new WSIncome.SwiftExpressWSIncome();
         var pResult   = "";
         var ds        = objIncome.GetOperator(Session["connectionString"].ToString(), ref pResult);
         if (pResult == "")
         {
             ASPxGridLookup1.DataSource = ds;
             ASPxGridLookup1.DataBind();
             Session["OPERATOR"] = ds;
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true);
         }
         objIncome.Dispose();
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!ValidarConexionYUsuarioLogueado(sender))
            {
                return;
            }
            if (!Page.IsPostBack)
            {
                try
                {
                    Session["GridPicking"]         = null;
                    Session["GridManifiesto"]      = null;
                    Session["DsDriver"]            = null;
                    Session["DsVehicle"]           = null;
                    Session["DsRoutes"]            = null;
                    Session["UiListaRuta"]         = null;
                    ASPxGridLookup1.GridView.Width = 300;
                    ASPxGridLookup2.GridView.Width = 300;
                    ASPxGridLookup3.GridView.Width = 300;
                    GetPicking();
                    GetDriver();
                    GetAllRoute();
                    GetVehicle();
                }
                catch (Exception ex)
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText",
                                                        "CallError('Error: " + ex.Message + "');", true);
                }
            }
            try
            {
                if (Session["UiListaRuta"] != null)
                {
                    UiListaRuta.DataSource = Session["UiListaRuta"];
                    UiListaRuta.DataBind();
                }
                else
                {
                    LlenarListaRuta();
                }

                if (Session["DsDriver"] != null)
                {
                    ASPxGridLookup1.DataSource = Session["dsDriver"];
                    ASPxGridLookup1.DataBind();
                }
                else
                {
                    GetDriver();
                }
                if (Session["DsVehicle"] != null)
                {
                    ASPxGridLookup2.DataSource = Session["DsVehicle"];
                    ASPxGridLookup2.DataBind();
                }
                else
                {
                    GetVehicle();
                }

                if (Session["DsRoutes"] != null)
                {
                    ASPxGridLookup3.DataSource = Session["DsRoutes"];
                    ASPxGridLookup3.DataBind();
                }
                else
                {
                    GetAllRoute();
                }
                if (Session["GridPicking"] != null)
                {
                    ASPxGridView1.DataSource = Session["GridPicking"];
                    ASPxGridView1.DataBind();
                    ReportViewer();
                }
                else
                {
                    GetPicking();
                }
                if (Session["GridManifiesto"] == null)
                {
                    return;
                }
                ASPxGridView2.DataSource = Session["GridManifiesto"];
                ASPxGridView2.DataBind();
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText",
                                                    "CallError('Error: " + ex.Message + "');", true);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!ValidarConexionYUsuarioLogueado(sender))
            {
                return;
            }
            if (!IsPostBack)
            {
                Session["SAP_PICKING_DATA"] = null;
            }

            if (Session["SAP_PICKING_DATA"] != null)
            {
                ASPxGridView2.DataSource = Session["SAP_PICKING_DATA"];
                ASPxGridView2.DataBind();
            }
            ASPxGridLookup1.GridView.Width = 200;
            ASPxGridLookup3.GridView.Width = 250;
            ASPxGridLookup2.GridView.Width = 200;
            if (Request["__EVENTARGUMENT"] == "KeyPressSpE")
            {
                try
                {
                    if ((string)Session["UPDATE_TEMP_PICKING"] == "true")
                    {
                        _result = _wscalled.UpdateDetailPicking((int)Session["PICKING_DETAIL"], Convert.ToString(ASPxGridLookup3.Value), Convert.ToString(ASPxGridLookup3.Text), Convert.ToInt32(ASPxSpinEdit1.Number), Session["connectionString"].ToString());
                        Session["UPDATE_TEMP_PICKING"] = "false";
                        Session["DISPATCH"]            = ASPxSpinEdit1.Number;
                        var pResult  = "";
                        var dsDetail = _wscalled.GetPickingDetailForPickingHeader((int)Session["Header_picking"],
                                                                                  Session["connectionString"].ToString(), ref pResult);
                        if (pResult == "")
                        {
                            ASPxGridView1.DataSource = dsDetail;
                            ASPxGridView1.DataBind();

                            Session["dsPicking"] = dsDetail;
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true);
                        }
                        ASPxSpinEdit1.Number = 0;
                        ASPxGridLookup3.Text = "";
                    }

                    else if ((string)Session["INGRESO_HEADER_PICKING"] == "TRUE")
                    {
                        _result = _wscalled.InsertPickingetail((int)Session["Header_picking"], Convert.ToString(ASPxGridLookup3.Value), Convert.ToDecimal(ASPxSpinEdit1.Number), Session["connectionString"].ToString(), ASPxGridLookup3.Text);
                        var pResult  = "";
                        var dsDetail = _wscalled.GetPickingDetailForPickingHeader((int)Session["Header_picking"], Session["connectionString"].ToString(), ref pResult);
                        if (pResult == "")
                        {
                            ASPxGridView1.DataSource = dsDetail;
                            ASPxGridView1.DataBind();
                            Session["dsPicking"] = dsDetail;
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true);
                        }
                        ASPxSpinEdit1.Number = 0;
                        ASPxGridLookup3.Text = "";
                    }
                    else
                    {
                        if ((string)Session["UPDATE_TEMP_PICKING"] == "true")
                        {
                            _result = _wscalled.UpdateDetailPicking((int)Session["PICKING_DETAIL"], Convert.ToString(ASPxGridLookup3.Value), Convert.ToString(ASPxGridLookup3.Text), Convert.ToInt32(ASPxSpinEdit1.Number), Session["connectionString"].ToString());
                            Session["UPDATE_TEMP_PICKING"] = "false";
                            Session["DISPATCH"]            = ASPxSpinEdit1.Number;
                            var pResult  = "";
                            var dsDetail = _wscalled.GetPickingDetailForPickingHeader((int)Session["Header_picking"], Session["connectionString"].ToString(), ref pResult);
                            if (pResult == "")
                            {
                                ASPxGridView1.DataSource = dsDetail;
                                ASPxGridView1.DataBind();
                                Session["dsPicking"] = dsDetail;
                            }
                            else
                            {
                                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true);
                            }
                            ASPxSpinEdit1.Number = 0;
                            ASPxGridLookup3.Text = "";
                        }
                        else
                        {
                            _result = _wscalled.InsertPickingTemp(Convert.ToString(ASPxComboBox1.Value), Convert.ToString(ASPxGridLookup1.Value), Convert.ToString(ASPxGridLookup2.Text), ASPxSpinEdit2.Text, ASPxSpinEdit3.Text, Session["USER"].ToString(), Session["connectionString"].ToString(), ASPxDateEdit1.Date, Convert.ToInt32(ASPxComboBox2.Value));
                            Session["INGRESO_HEADER_PICKING"] = "TRUE";
                            var pResult  = "";
                            var dsNumber = _wscalled.GetNumberHeaderPicking(Session["connectionString"].ToString(), ref pResult);
                            if (pResult == "")
                            {
                                Session["Header_picking"] =
                                    Convert.ToInt32(dsNumber.Tables[0].Rows[0]["PICKING_HEADER"]);
                                _wscalled.InsertPickingetail(
                                    Convert.ToInt32(dsNumber.Tables[0].Rows[0]["PICKING_HEADER"]),
                                    Convert.ToString(ASPxGridLookup3.Value), Convert.ToDecimal(ASPxSpinEdit1.Number),
                                    Session["connectionString"].ToString(), ASPxGridLookup3.Text);
                                var pResult2 = "";
                                var dsDetail =
                                    _wscalled.GetPickingDetailForPickingHeader((int)Session["Header_picking"],
                                                                               Session["connectionString"].ToString(), ref pResult2);
                                if (pResult2 == "")
                                {
                                    ASPxGridView1.DataSource = dsDetail;
                                    ASPxGridView1.DataBind();
                                    Session["dsPicking"] = dsDetail;
                                }
                                else
                                {
                                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult2 + "');", true);
                                }
                                ASPxSpinEdit1.Number = 0;
                                ASPxGridLookup3.Text = "";
                            }
                            else
                            {
                                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
                }
            }

            if (!Page.IsPostBack)
            {
                try
                {
                    Session["LIST_DOC_ERP_PICKING"] = null;
                    Session["UiListaBodega"]        = null;
                    Session["CODE_WAREHOUSE"]       = "";
                    ASPxDateEdit1.Date = DateTime.Now;
                    Session["INGRESO_HEADER_PICKING"] = "FALSE";
                    GetClassificationPicking();
                    GetAllCostumers();
                    GetOperator();
                    GetSku();
                    Session["SavePicking"] = "false";
                    Session["dsPicking"]   = null;
                    LlenarListaDocErp();
                    LlenarListaBodegas();
                }
                catch (Exception ex)
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
                }
            }
            try
            {
                GetSku();
                ASPxGridLookup2.DataSource = Session["OPERATOR"];
                ASPxGridLookup2.DataBind();
                ASPxGridLookup1.DataSource = Session["CUSTOMER"];
                ASPxGridLookup1.DataBind();
                ASPxGridView1.DataSource = Session["dsPicking"];
                ASPxGridView1.DataBind();


                if (Session["LIST_DOC_ERP_PICKING"] != null)
                {
                    UiListaPedidosErp.DataSource = Session["LIST_DOC_ERP_PICKING"];
                    UiListaPedidosErp.DataBind();
                }

                if (!string.IsNullOrEmpty(Session["CODE_WAREHOUSE"].ToString()))
                {
                    LlenarListaBodegas();

                    UiListaBodega.Enabled    = true;
                    UiListaBodegaErp.Enabled = true;

                    UiListaBodega.Value    = Session["CODE_WAREHOUSE"];
                    UiListaBodegaErp.Value = Session["CODE_WAREHOUSE"];

                    UiListaBodega.Enabled    = false;
                    UiListaBodegaErp.Enabled = false;
                }
                else
                {
                    LlenarListaBodegas();
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }

            ReportView();
        }