예제 #1
0
파일: View.ascx.cs 프로젝트: dchaves80/GDNN
        void InterpretarRequest()
        {
            if (Request["scroll"] != null && Request["k"] != null && Session[FacturaSesssionKEY] != null)
            {
                Data2.Class.Struct_Factura FACTURA = Session[FacturaSesssionKEY] as Data2.Class.Struct_Factura;
                for (int a = 0; a < FACTURA.GetDetalle().Count; a++)
                {
                    if (FACTURA.GetDetalle()[a].ACCESSKEY == Request["k"].ToString())
                    {
                        hf_Scroll.Value        = "1";
                        hf_ScrollControl.Value = "#SetCant" + a.ToString();
                    }
                }
            }

            if (Request["setcant"] != null && Request["k"] != null)
            {
                string value = Request["setcant"];
                string k     = Request["k"];
                AddCant(value, k);
            }

            if (Request["Del"] != null)
            {
                string k = Request["Del"].ToString();
                Data2.Class.Struct_Factura FACTURA = Session[FacturaSesssionKEY] as Data2.Class.Struct_Factura;
                FACTURA.BorrarDetalle(k);
                Session.Remove(FacturaSesssionKEY);
                Session.Add(FacturaSesssionKEY, FACTURA);
                redirecttome("");
            }

            if (Request["Add"] != null)
            {
                try
                {
                    int IdProduct = int.Parse(Request["Add"].ToString());
                    if (Session[FacturaSesssionKEY] != null)
                    {
                        Data2.Class.Struct_Factura FACTURA = Session[FacturaSesssionKEY] as Data2.Class.Struct_Factura;

                        if (IdProduct != 0)
                        {
                            AgregarProducto(IdProduct, FACTURA);
                        }
                    }
                }
                catch (Exception E)
                {
                    Log.ADD("Error Maestro:" + "[" + E.Message + "]\n[" + E.StackTrace + "]", this);
                }
            }
        }
예제 #2
0
        void AgregarArticulo(string ArtCod, string cant)
        {
            if (Session[key_session_factura] != null)
            {
                try
                {
                    Data2.Class.Struct_Factura SF = Session[key_session_factura] as Data2.Class.Struct_Factura;



                    SF.AddDetail(ArtCod);
                    SF.GetDetalle()[SF.GetDetalle().Count - 1].set_cant(cant.ToString());
                    redirecttome();
                }
                catch { }
            }
        }
예제 #3
0
        void AgregarArticulo(string ArtCod, string cant)
        {
            if (Session[key_session_factura] != null)
            {
                try
                {
                    Data2.Class.Struct_Factura SF = Session[key_session_factura] as Data2.Class.Struct_Factura;
                    if (cant == "0")
                    {
                        Struct_Treatment TreatArticle = Struct_Treatment.GetTreatmentById(int.Parse(ArtCod));
                        SF.AddDetail(TreatArticle.Id, true);
                    }
                    else
                    {
                        SF.AddDetail(ArtCod);
                        SF.GetDetalle()[SF.GetDetalle().Count - 1].set_cant(cant.ToString());
                    }

                    redirecttome();
                }
                catch { }
            }
        }