예제 #1
0
파일: XmlDb.cs 프로젝트: skepee/XmlDb
        public void UpdateItem(string tableName, Dictionary <string, string> myCurrentData, Dictionary <string, string> myNewData)
        {
            var xmldt = GetItem(tableName);

            if (xmldt != null)
            {
                xmldt.Update(myCurrentData, myNewData);
                Ds.AcceptChanges();
                Ds.WriteXml(DataBasePathFile);
            }

            if (LogDataObject != null)
            {
                AddLogItem(myNewData, "update", tableName);
            }
        }
예제 #2
0
파일: XmlDb.cs 프로젝트: skepee/XmlDb
        public void RemoveItem(string tableName, Dictionary <string, string> myData)
        {
            var xmldt = GetItem(tableName);

            if (xmldt != null)
            {
                xmldt.Remove(myData);
                Ds.AcceptChanges();
                Ds.WriteXml(DataBasePathFile);
            }

            if (LogDataObject != null)
            {
                AddLogItem(myData, "remove", tableName);
            }
        }
예제 #3
0
파일: XmlDb.cs 프로젝트: skepee/XmlDb
        public void AddListItem(string tableName, List <Dictionary <string, string> > myData)
        {
            var xmldt = GetItem(tableName);

            if (xmldt != null)
            {
                foreach (var item in myData)
                {
                    AddItem(tableName, item);

                    if (LogDataObject != null)
                    {
                        AddLogItem(item, "add", tableName);
                    }
                }
                Ds.AcceptChanges();
                Ds.WriteXml(DataBasePathFile);
            }
        }
예제 #4
0
파일: Carrito.cs 프로젝트: rjmnz91/ZGM-MIT
        public DataSet CargaPagos()
        {
            DataSet Ds;

            DLLGestionVenta.ProcesarVenta objVenta = new DLLGestionVenta.ProcesarVenta();
            objVenta.ConexString = System.Configuration.ConfigurationManager.ConnectionStrings["MC_TDAConnectionString"].ToString();

            Ds = objVenta.GetPago(this.IdCarrito);

            float total = 0;

            if (Ds.Tables.Count > 0)
            {
                //this.DatosCliente9.TotalPagosPar9 = (from DataRow Dr in Ds.Tables[0].Rows where Dr["Tipo"].ToString().ToUpper().Equals("PAR 9") select Dr).Count();
                //this.DatosCliente9.TotalPagosBolsa5 = (from DataRow Dr in Ds.Tables[0].Rows where Dr["Tipo"].ToString().ToUpper().Equals("BOLSA 5") select Dr).Count();
                //this.DatosCliente9.TotalPagosPuntos9 = (from DataRow Dr in Ds.Tables[0].Rows where Dr["Tipo"].ToString().ToUpper().Equals("PUNTOS 9") select Dr).Count();

                foreach (DataRow Dr in Ds.Tables[0].Rows)
                {
                    total += float.Parse(Dr["Importe"].ToString());

                    if (Dr["Tipo"].ToString().Equals("PAR 9"))
                    {
                        this.DatosCliente9.TotalPagosPar9++;
                    }
                    if (Dr["Tipo"].ToString().Equals("BOLSA 5"))
                    {
                        this.DatosCliente9.TotalPagosBolsa5++;
                    }
                    if (Dr["Tipo"].ToString().Equals("PUNTOS 9"))
                    {
                        this.DatosCliente9.TotalPagosPar9++;
                    }
                }

                DataRow row = Ds.Tables[0].NewRow();
                row["Tipo"]      = "Total Pagado:";
                row["Importe"]   = total;
                this.TotalPagado = total;

                Ds.Tables[0].Rows.Add(row);
                Ds.AcceptChanges();
            }
            else
            {
                //divResumen.Visible = false;
            }

            return(Ds);

            //float fSubtotal = 0;
            //float fDescuento = 0;
            //float fTotalPagar = 0;

            //if (float.TryParse(ViewState["SubTotal"].ToString(), out fSubtotal))
            //{
            //    fDescuento = float.Parse(ViewState["ImporteDescuentos"].ToString());
            //    fTotalPagar = (fSubtotal - fDescuento);
            //}

            //float fTotal = (fTotalPagar - TotalPagado);
            //TotPendiente.Text = FormateaNumero(fTotal.ToString());

            //if (fTotal == 0 && fTotalPagar > 0)
            //{
            //    Divfinalizar.Visible = true;
            //    RadioButtonlTipoPago.CssClass = "ocul1";
            //    RadioButton1.CssClass = "Ocultarcontrol";
            //    btnEnviarPOS.Visible = false;
            //    RadioButton1.CssClass = "Ocultarcontrol";
            //}

            //if (Session["ClienteNine"] != null)
            //{
            //    int pares;
            //    int paresRegalado;
            //    int Bolsa;
            //    int BolsaRegalado;

            //    CLIENTE9 objCliente = (CLIENTE9)(Session["ClienteNine"]);

            //    if (objCliente.BolsaPagada > 0 || objCliente.ParPagado > 0 || objCliente.PuntosPagados > 0)
            //    {
            //        Label10.Text = (double.Parse(Label10.Text.ToString()) - objCliente.PuntosPagados).ToString();
            //        pares = int.Parse(Label13.Text.ToString().Split('(')[0].ToString());
            //        paresRegalado = int.Parse(Label13.Text.ToString().Split('(')[1].ToString().Replace(")", ""));
            //        Bolsa = int.Parse(Label14.Text.ToString().Split('(')[0].ToString());
            //        BolsaRegalado = int.Parse(Label14.Text.ToString().Split('(')[1].ToString().Replace(")", ""));
            //        pares = pares - (int.Parse(objCliente.ParPagado.ToString())) * 8;
            //        paresRegalado = (paresRegalado > 0 ? paresRegalado - int.Parse(objCliente.ParPagado.ToString()) : 0);
            //        Bolsa = Bolsa - (int.Parse(objCliente.BolsaPagada.ToString())) * 4;
            //        BolsaRegalado = (BolsaRegalado > 0 ? BolsaRegalado - int.Parse(objCliente.BolsaPagada.ToString()) : 0);
            //        Label11.Text = (paresRegalado > 0 ? Label11.Text : "0");
            //        Label12.Text = (BolsaRegalado > 0 ? Label12.Text : "0");
            //        Label13.Text = pares.ToString() + "(" + paresRegalado.ToString() + ")";
            //        Label14.Text = Bolsa + "(" + BolsaRegalado.ToString() + ")";
            //        //VALIDAMOS PAR9
            //        if (Int64.Parse(paresRegalado.ToString()) > 0)
            //        {
            //            RadioButton3.Enabled = true;
            //        }
            //        else
            //        {
            //            RadioButton3.Enabled = false;
            //        }
            //        //VALIDAMOS BOLSA5
            //        if (Int64.Parse(BolsaRegalado.ToString()) > 0)
            //        {
            //            RadioButton4.Enabled = true;
            //        }
            //        else
            //        {
            //            RadioButton4.Enabled = false;
            //        }
            //    }
            //}
        }