コード例 #1
0
        protected void RadGrid2_ItemCommand(object source, GridCommandEventArgs e)
        {
            if ((e.CommandName == "PerformInsert") || (e.CommandName == "Update"))
            {
                GridEditFormItem item = (GridEditFormItem)e.Item;
                int pathroutekey      = 0;
                if (e.CommandName == "Update")
                {
                    pathroutekey = Convert.ToInt32(item.GetDataKeyValue("path_route_key"));
                }
                int pathkey   = Convert.ToInt32(hdpathkey.Value);
                int marketkey = Convert.ToInt32((item["market_key2"].FindControl("ddlmarket") as RadComboBox).SelectedValue);

                Bitcoin_Notify_DB.SPs.UpdatePathRoute(pathroutekey, pathkey, marketkey).Execute();

                RadGrid2.MasterTableView.ClearEditItems();
                //string firstname = (item["first_name"].Controls[0] as TextBox).Text;
            }
            else if (e.CommandName == "Delete")
            {
                GridDataItem item         = (GridDataItem)e.Item;
                int          pathroutekey = Convert.ToInt32(item.GetDataKeyValue("path_route_key"));

                Bitcoin_Notify_DB.SPs.DeletePathRoute(pathroutekey).Execute();

                RadGrid2.Rebind();
                //int userkey = Convert.ToInt32(item["user_key"].Text);
            }
        }
コード例 #2
0
 protected void lnkEliminarEntrada_Click(object sender, EventArgs e)
 {
     lblError.Text = "";
     try
     {
         LinkButton btn      = (LinkButton)sender;
         string     id       = btn.CommandArgument.ToString();
         Entradas   entradas = new Entradas();
         entradas.entrada = Convert.ToInt32(id);
         entradas.tienda  = Convert.ToInt32(RadGrid1.SelectedValues["id_punto"].ToString());
         entradas.eliminarEntrada();
         if (Convert.ToBoolean(entradas.retorno[0]))
         {
             lblError.Text = "Entrada Eliminada Existosamente";
             RadGrid2.Rebind();
         }
         else
         {
             lblError.Text = "Error al eliminar la entrada. Detalle: " + Convert.ToString(entradas.retorno[1]);
         }
     }
     catch (Exception ex)
     {
         lblError.Text = "Error al eliminar la entrada. Detalle: " + ex.Message;
     }
 }
コード例 #3
0
        protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
        {
            if ((e.CommandName == "PerformInsert") || (e.CommandName == "Update"))
            {
                GridEditFormItem item = (GridEditFormItem)e.Item;
                int pathkey           = 0;
                if (e.CommandName == "Update")
                {
                    pathkey = Convert.ToInt32(item.GetDataKeyValue("path_key"));
                }
                int order = Convert.ToInt32((item["page_order"].Controls[0] as TextBox).Text);

                Bitcoin_Notify_DB.SPs.UpdatePath(pathkey, order).Execute();

                RadGrid1.MasterTableView.ClearEditItems();
            }
            else if (e.CommandName == "Route")
            {
                GridDataItem item     = (GridDataItem)e.Item;
                int          pathkey  = Convert.ToInt32(item["path_key"].Text);
                string       pathname = item["path_name"].Text;
                hdpathkey.Value = pathkey.ToString();
                lblpath.Text    = pathkey.ToString() + " - " + pathname;
                RadGrid2.Rebind();
            }
            else if (e.CommandName == "Delete")
            {
                GridDataItem item    = (GridDataItem)e.Item;
                int          pathkey = Convert.ToInt32(item.GetDataKeyValue("path_key"));

                Bitcoin_Notify_DB.SPs.DeletePath(pathkey).Execute();
                RadGrid1.MasterTableView.ClearEditItems();
            }
        }
コード例 #4
0
    //protected void Page_PreRender(object sender, EventArgs e)
    //{
    //    if (RadGrid2.SelectedIndexes.Count == 0)
    //        RadGrid2.SelectedIndexes.Add(0);
    //    if (RadGrid3.SelectedIndexes.Count == 0)
    //    {
    //        RadGrid3.Rebind();
    //        RadGrid3.SelectedIndexes.Add(0);
    //    }
    //}

    //protected void RadGrid2_ItemCommand(object sender, GridCommandEventArgs e)
    //{
    //    RadGrid3.SelectedIndexes.Clear();
    //}

    protected void RadComboBox1_DataBound(object sender, EventArgs e)
    {
        SqlDataSource2.SelectParameters[0].DefaultValue = RadComboBox1.SelectedValue.ToString();
        SqlDataSource3.SelectParameters[0].DefaultValue = RadComboBox1.SelectedValue.ToString();

        RadGrid2.Rebind();
    }
コード例 #5
0
    protected void RadComboBox1_DataBound(object sender, EventArgs e)
    {
        DateTime?day0 = DateTime.Parse(RadComboBox1.SelectedValue.ToString());
        DateTime?day1 = day0.Value.AddDays(1);
        DateTime?day2 = day0.Value.AddDays(2);
        DateTime?day3 = day0.Value.AddDays(3);
        DateTime?day4 = day0.Value.AddDays(4);
        DateTime?day5 = day0.Value.AddDays(5);
        DateTime?day6 = day0.Value.AddDays(6);

        SqlDataSource2.SelectParameters[0].DefaultValue = RadComboBox1.SelectedValue.ToString();

        RadGrid2.MasterTableView.Columns[3].HeaderText = day0.Value.ToShortDateString();
        RadGrid2.MasterTableView.Columns[4].HeaderText = day1.Value.ToShortDateString();
        RadGrid2.MasterTableView.Columns[5].HeaderText = day2.Value.ToShortDateString();
        RadGrid2.MasterTableView.Columns[6].HeaderText = day3.Value.ToShortDateString();
        RadGrid2.MasterTableView.Columns[7].HeaderText = day4.Value.ToShortDateString();
        RadGrid2.MasterTableView.Columns[8].HeaderText = day5.Value.ToShortDateString();
        RadGrid2.MasterTableView.Columns[9].HeaderText = day6.Value.ToShortDateString();
        RadGrid2.Rebind();

        SqlDataSource3.SelectParameters[0].DefaultValue = RadComboBox1.SelectedValue.ToString();
        RadGrid3.Rebind();

        SqlDataSource4.SelectParameters[0].DefaultValue = RadComboBox1.SelectedValue.ToString();
        RadGrid4.Rebind();

        SqlDataSource5.SelectParameters[0].DefaultValue = RadComboBox1.SelectedValue.ToString();
        RadGrid5.Rebind();
    }
コード例 #6
0
 private void limpiaCampos()
 {
     lblError.Text              = "";
     ddlPais.Text               = "";
     ddlPais.SelectedIndex      = -1;
     ddlEstado.Text             = "";
     ddlEstado.SelectedIndex    = -1;
     ddlMunicipio.Text          = "";
     ddlMunicipio.SelectedIndex = -1;
     ddlColonia.Text            = "";
     ddlColonia.SelectedIndex   = -1;
     ddlCodigo.Text             = "";
     ddlCodigo.SelectedIndex    = -1;
     txtRazonNew.Text           = "";
     txtLocalidad.Text          = "";
     txtReferenciaMod.Text      = "";
     txtRfcCap.Text             = "";
     txtCalle.Text              = "";
     txtNoExt.Text              = "";
     txtNoIntMod.Text           = "";
     txtCorreo.Text             = "";
     txtCorreoCC.Text           = "";
     txtCorreoCCO.Text          = "";
     facDatos.borrar(Request.QueryString["u"]);
     RadGrid1.Rebind();
     RadGrid2.Rebind();
     // lblUsuario.Text = lblTotal.Text = lblSubTotal.Text = lblIVA.Text = lblHora.Text = lblFecha.Text = lblNeto.Text = lblDesceunto.Text = lblDescuentoPorc.Text = "";
 }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    txtFecha.DbSelectedDate = Request.QueryString["fecha"].ToString().Substring(0, 2) + "/" + Request.QueryString["fecha"].ToString().Substring(2, 2) + "/" + Request.QueryString["fecha"].ToString().Substring(4, 4);
                    txtOrden.Text           = Request.QueryString["orden"].ToString();
                    RadGrid1.Rebind();
                    RadGrid2.Rebind();

                    double ancho = 0;
                    foreach (GridColumn gc in RadGrid1.Columns)
                    {
                        if (gc.Display)
                        {
                            ancho = ancho + gc.HeaderStyle.Width.Value;
                        }
                    }
                    RadGrid1.Width = Unit.Pixel(Convert.ToInt32(ancho) + 20);
                    RadGrid1.MasterTableView.Width = Unit.Pixel(Convert.ToInt32(ancho));
                }
                catch (Exception ex)
                {
                    ErrorManager(ex, new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name);
                }
            }
        }
コード例 #8
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            Session["skuid"]  = skuid;
            Session["loadid"] = loadid;
            Session["areaid"] = areaid;

            RadGrid1.Rebind();
            RadGrid2.Rebind();
            SetFocus(TB_sku);
        }
コード例 #9
0
 protected void Page_PreRender(object sender, EventArgs e)
 {
     if (MessagesGrid.SelectedIndexes.Count == 0)
     {
         MessagesGrid.SelectedIndexes.Add(0);
     }
     if (RadGrid2.SelectedIndexes.Count == 0)
     {
         RadGrid2.Rebind();
         RadGrid2.SelectedIndexes.Add(0);
     }
 }
コード例 #10
0
        protected void Button3_Click(object sender, EventArgs e)
        {
            string carr_id = DD_carrier.SelectedItem.Value;

            try
            {
                // get carrier barcode


                CageReportsDAO crdao       = new CageReportsDAO();
                string         carrbarcode = crdao.GetCarrierBarcode(carr_id);

                // get cage barcode
                Button       btn      = (Button)sender;
                GridDataItem dataitem = (GridDataItem)btn.NamingContainer;

                String scageid = dataitem.GetDataKeyValue("cage_id").ToString();
                Int32  icageid = Int32.Parse(scageid);

                string cagebarcode = crdao.GetCageBarcode(icageid);

                // call ready to despatch


                DespatchDAO desdao = new DespatchDAO();


                string cagename = desdao.ProcessBarcode(carrbarcode, cagebarcode, username);

                Label1.Text      = "Cage " + scageid + " Is Ready For despatch";
                Label1.ForeColor = Color.Blue;

                Label1.Visible = true;
            }
            catch (Exception ex)
            {
                Label1.Text      = "Error:" + ex.Message.Substring(ex.Message.IndexOf(" ", 0), (ex.Message.IndexOf("ORA", 1) - ex.Message.IndexOf(" ", 0)));
                Label1.Visible   = true;
                Label1.ForeColor = Color.Red;
            }


            //RadGrid2.Rebind();

            this.BindData_troverview(carr_id);

            RadGrid2.Rebind();

            GetCageIds();
            HiddenField1.Value = cages;
        }
コード例 #11
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (txt_stDate.Text.ToString() == string.Empty)
     {
         string errmsg = "Please Enter Date";
         Label1.Visible   = true;
         Label1.Text      = errmsg;
         Label1.ForeColor = Color.Red;
     }
     else
     {
         RadGrid2.Rebind();
     }
 }
コード例 #12
0
 protected void subn_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrWhiteSpace(flightnumber.Text))
     {
         Label1.Text      = "Please enter flight number";
         RadGrid2.Visible = false;
     }
     else
     {
         RadGrid2.Visible    = true;
         RadGrid2.DataSource = GetDataTable();
         RadGrid2.Rebind();
     }
 }
コード例 #13
0
        protected void RebindGrids(DataTable dt)
        {
            Session["QPR.IKU"] = dt;
            RadGrid1.Rebind();

            DataView view = new DataView(dt);

            if (chkShowEmpty.Checked)
            {
                view.RowFilter = "KODE_SATKER = ''";
            }
            Session["QPR.MAP"] = view.ToTable(true, "MEA_ID", "NAMA_SATKER", "KODE_SATKER", "NAMA_UNIT");
            RadGrid2.Rebind();

            btnImport.Enabled = (Session["QPR.IKU"] != null);
        }
コード例 #14
0
 protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
 {
     if (e.Argument == "Rebind")
     {
         RadGrid2.MasterTableView.SortExpressions.Clear();
         RadGrid2.MasterTableView.GroupByExpressions.Clear();
         RadGrid2.Rebind();
     }
     else if (e.Argument == "RebindAndNavigate")
     {
         RadGrid2.MasterTableView.SortExpressions.Clear();
         RadGrid2.MasterTableView.GroupByExpressions.Clear();
         RadGrid2.MasterTableView.CurrentPageIndex = RadGrid2.MasterTableView.PageCount - 1;
         RadGrid2.Rebind();
     }
 }
コード例 #15
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            DateTime sdate = DateTime.MinValue;
            DateTime edate = DateTime.MinValue;

            if (txt_stDate.Text.ToString() != string.Empty)
            {
                sdate = DateTime.Parse(txt_stDate.Text);
            }
            if (txt_endDate.Text.ToString() != string.Empty)
            {
                edate = DateTime.Parse(txt_endDate.Text);
            }

            if (txt_stDate.Text.ToString() == string.Empty && txt_endDate.Text.ToString() != string.Empty)
            {
                string errmsg = "Please Enter Start Date";
                Label1.Visible   = true;
                Label1.Text      = errmsg;
                Label1.ForeColor = Color.Red;
            }
            else
            {
                if (sdate > edate)
                {
                    string errmsg = "Start Date should be less than equal to End Date";
                    Label1.Visible   = true;
                    Label1.Text      = errmsg;
                    Label1.ForeColor = Color.Red;
                }
                else
                {
                    if (edate.Subtract(sdate).Days > 100)
                    {
                        string errmsg = "Search cannot exceed 100 days";
                        Label1.Visible   = true;
                        Label1.Text      = errmsg;
                        Label1.ForeColor = Color.Red;
                    }
                    else
                    {
                        RadGrid2.Rebind();
                    }
                }
            }
        }
コード例 #16
0
 protected void RadButton2_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrWhiteSpace(custname.Text))
     {
         Label3.Text      = "Please enter customer name";
         RadGrid2.Visible = false;
     }
     else
     {
         Label1.Text         = "";
         Label2.Text         = "";
         Label3.Text         = "";
         RadGrid2.Visible    = true;
         RadGrid2.DataSource = getCustTable();
         RadGrid2.Rebind();
     }
 }
コード例 #17
0
    protected void  RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        DateTime?day0 = DateTime.Parse(RadComboBox1.SelectedValue.ToString());
        DateTime?day1 = day0.Value.AddDays(1);
        DateTime?day2 = day0.Value.AddDays(2);
        DateTime?day3 = day0.Value.AddDays(3);
        DateTime?day4 = day0.Value.AddDays(4);
        DateTime?day5 = day0.Value.AddDays(5);
        DateTime?day6 = day0.Value.AddDays(6);

        RadGrid2.MasterTableView.Columns[3].HeaderText = day0.Value.ToShortDateString();
        RadGrid2.MasterTableView.Columns[4].HeaderText = day1.Value.ToShortDateString();
        RadGrid2.MasterTableView.Columns[5].HeaderText = day2.Value.ToShortDateString();
        RadGrid2.MasterTableView.Columns[6].HeaderText = day3.Value.ToShortDateString();
        RadGrid2.MasterTableView.Columns[7].HeaderText = day4.Value.ToShortDateString();
        RadGrid2.MasterTableView.Columns[8].HeaderText = day5.Value.ToShortDateString();
        RadGrid2.MasterTableView.Columns[9].HeaderText = day6.Value.ToShortDateString();
        RadGrid2.Rebind();
    }
コード例 #18
0
        protected void RadButton2_Click(object sender, EventArgs e)
        {
            string arrivalcode, deparcode;

            arrivalcode = Arrivalcode.SelectedValue.ToString();
            deparcode   = departurecode.SelectedValue.ToString();
            if (arrivalcode == deparcode)
            {
                l12.Text         = "Arrival and departure code cannot be same.";
                RadGrid2.Visible = false;
            }
            else
            {
                l12.Text            = "";
                RadGrid2.Visible    = true;
                RadGrid2.DataSource = GetDataTable();
                RadGrid2.Rebind();
            }
        }
コード例 #19
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            string         carrid = DD_carrier.SelectedItem.Value;
            DespatchDAO    desdao = new DespatchDAO();
            CageReportsDAO crdao  = new CageReportsDAO();

            try
            {
                string carrbarcode = crdao.GetCarrierBarcode(carrid);

                decimal cagecount = desdao.ValidateCagesForDespatch(carrbarcode);
                if (cagecount > 0)
                {
                    string queueoutput = desdao.QueueForDespatch(carrbarcode, username);
                }

                this.BindData_troverview(carrid);

                RadGrid2.Rebind();

                CageReportsDAO cg_firstload = new CageReportsDAO();
                string         carrierid    = DD_carrier.SelectedItem.Value;
                string         cagesids     = cg_firstload.Getcageidstring(carrierid);
                if (cagesids == string.Empty || cagesids == "null" || cagesids == "0")
                {
                    Label1.Text = string.Empty;
                }
                else
                {
                    Label1.Text      = "Cages Despatched for " + carrid;
                    Label1.ForeColor = Color.Blue;
                }
            }
            catch (Exception Ex2)
            {
                Label1.Text      = "Error:" + Ex2.Message.Substring(Ex2.Message.IndexOf(" ", 0), (Ex2.Message.IndexOf("ORA", 1) - Ex2.Message.IndexOf(" ", 0)));
                Label1.Visible   = true;
                Label1.ForeColor = Color.Red;
            }

            Label1.Visible = true;
        }
コード例 #20
0
 protected void btnBuscarFolio_Click(object sender, EventArgs e)
 {
     if (txtFolio.Text.Trim() != "")
     {
         string ticket       = txtFolio.Text;
         int    isla         = Convert.ToInt32(Request.QueryString["p"]);
         bool   existeTicket = facDatos.existeTicket(ticket, isla);
         if (existeTicket)
         {
             object[] agregado = facDatos.agregaTicket(isla, ticket, Request.QueryString["u"]);
             txtFolio.Text = "";
             RadGrid1.Rebind();
             RadGrid2.Rebind();
         }
         else
         {
             lblError.Text = "El ticket indicado no existe";
         }
     }
 }
コード例 #21
0
ファイル: UC_MDsHoaDon.ascx.cs プロジェクト: TVMD/KaraOKe
    protected void RadGrid2_OnDeleteCommand(object sender, GridCommandEventArgs e)
    {
        newValue     = new Hashtable();
        editableItem = e.Item as GridEditableItem;
        e.Item.OwnerTableView.ExtractValuesFromItem(newValue, editableItem);

        var          presenter = new PMCT_HDDV(this);
        GridDataItem item      = e.Item as GridDataItem;
        // get value from DataKey
        string str1 = item.GetDataKeyValue("ID_Hang").ToString();

        ID_HoaDon = GlobleIdHoaDon;
        ID_Hang   = int.Parse(str1);

        Message = presenter.Delete() ? "Xóa xong" : "Không xóa được nè";
        if (Message == "Xóa xong")
        {
            RadGrid1.DataBind();
            RadGrid1.Rebind();
            RadGrid2.Rebind();
        }
    }
コード例 #22
0
ファイル: UC_MDsHoaDon.ascx.cs プロジェクト: TVMD/KaraOKe
    protected void RadGrid2_OnUpdateCommand(object sender, GridCommandEventArgs e)
    {
        newValue     = new Hashtable();
        editableItem = e.Item as GridEditableItem;
        e.Item.OwnerTableView.ExtractValuesFromItem(newValue, editableItem);

        var presenter = new PMCT_HDDV(this);

        var cbb       = e.Item.FindControl("cbboxHang") as RadComboBox;
        var tbsoluong = e.Item.FindControl("txtsoluong") as RadNumericTextBox;

        ID_Hang   = Int32.Parse(cbb.SelectedValue);
        SoLuong   = int.Parse(tbsoluong.Text);
        ID_HoaDon = GlobleIdHoaDon;
        Message   = presenter.Update() ? "Đã cập nhật" : "Cập nhật bị lỗi";
        if (Message == "Đã cập nhật")
        {
            RadGrid1.DataBind();
            RadGrid1.Rebind();
            RadGrid2.Rebind();
        }
    }
コード例 #23
0
    protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
    {
        try
        {
            RadGrid2.Rebind();
            RadGrid3.Rebind();
            lblError.Text = "";
            object valor = "0"; try { valor = RadGrid2.SelectedValues["idServicio"]; }
            catch (Exception) { valor = "0"; }
            //imgLogo.ImageUrl = imgReference.ImageUrl = string.Format("DisplayLogo.ashx?id={0};{1};1", RadGrid1.SelectedValue, valor.ToString());

            lblIdCatTipoServicio.Text = RadGrid1.SelectedValue.ToString();
            lblIdServicio.Text        = lblTipoFront.Text = lblIdProducto.Text = "0";
            lblDescripcion.Text       = "";
            txtTelefono.Text          = txtReferencia.Text = txtMonto.Text = "";
            Label1.Visible            = Label2.Visible = Label4.Visible = Label5.Visible = Label6.Visible = false;
            txtTelefono.Visible       = txtTelefonoConfirm.Visible = txtDigito.Visible = txtReferencia.Visible = txtMonto.Visible = false;
            lnkAbonar.Visible         = false;

            lblReferenciaInfo.Text = "";
            imgReference.Visible   = false;
        }
        catch (Exception) { lblIdCatTipoServicio.Text = lblIdServicio.Text = lblTipoFront.Text = lblIdProducto.Text = "0"; lblServicio.Text = ""; }
    }
コード例 #24
0
        protected void RadButton1_Click(object sender, EventArgs e)
        {
            bool hasValue = RadDatePicker1.SelectedDate.HasValue;

            if (!hasValue)
            {
                Label2.Text      = "Please Enter date";
                RadGrid2.Visible = false;
            }
            else if (string.IsNullOrWhiteSpace(flightnumber.Text))
            {
                Label1.Text      = "Please enter flight number";
                RadGrid2.Visible = false;
            }
            else
            {
                Label1.Text         = "";
                Label2.Text         = "";
                Label3.Text         = "";
                RadGrid2.Visible    = true;
                RadGrid2.DataSource = GetDataTable();
                RadGrid2.Rebind();
            }
        }
コード例 #25
0
    protected void btnGuardaEnt_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            List <pvAccom.Clases.EntradaProd> lstEntProd = (List <pvAccom.Clases.EntradaProd>)Session["lstEntProd"];
            if (lstEntProd != null)
            {
                try
                {
                    short    intIsla      = Convert.ToInt16(RadGrid1.SelectedValues["id_punto"]);
                    string   strDoc       = txtDocu.Text;
                    DateTime strFechaDoc  = Convert.ToDateTime(txtFechaDoc.Text);
                    int      intProveedor = int.Parse(ddlProve.SelectedValue);
                    string   strTipoDoc   = ddlTipoDoc.SelectedValue;
                    float    floSubTot    = 0;
                    float    floTotIva    = 0;
                    decimal  intSumaProds = 0;
                    float    iva          = 0.16F; //Sacar este valor de BD o WebConfig
                    foreach (pvAccom.Clases.EntradaProd ep in lstEntProd)
                    {
                        floSubTot     = floSubTot + ep.entImporte;
                        intSumaProds += Convert.ToDecimal(ep.entCant);
                    }
                    floTotIva = (floSubTot * iva);
                    float  floTotal      = floSubTot + floTotIva;
                    string intEntFolioID = pvAccom.Clases.EntradaProd.guardaEntEncabezado(intIsla, strDoc, strFechaDoc, intProveedor, strTipoDoc, floSubTot, floTotIva, floTotal, intSumaProds, Request.QueryString["u"], lstEntProd, lblEntrada.Text);
                    int    folio         = 0;
                    try { folio = Convert.ToInt32(intEntFolioID); }
                    catch (Exception) { folio = 0; }
                    if (folio != 0)
                    {
                        Session.Remove("lstEntProd");
                        //ddlIsla.SelectedIndex = 0;
                        ddlProve.SelectedIndex   = 0;
                        txtDocu.Text             = "";
                        ddlTipoDoc.SelectedIndex = 0;
                        txtFechaDoc.Text         = fechas.obtieneFechaLocal().ToString("yyyy-MM-dd");
                        CargaGrdVacio();
                        //grdDetProductos.DataBind();
                        RadGrid2.Rebind();

                        lblSubT.Text       = lblIva.Text = lblTotIva.Text = lblTotal.Text = lblTotalVenta.Text = Convert.ToDecimal("0").ToString("C2");
                        lblSumaProds.Text  = "Total Productos: 0";
                        btnOrdenes.Visible = false;
                        if (lblEntrada.Text != "0")
                        {
                            pnlMask.Visible        = false;
                            pnlPopupNvoDoc.Visible = false;
                        }
                        lblEntrada.Text = "0";
                    }
                }
                catch (Exception ex)
                {
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "alert('Se presento un error al intentar generar la entrada, por favor refresque la ventana y vuelva a intentarlo. Detalle: " + ex.Message + "')", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "alert('Se presento un error al intentar generar la entrada, la lista de productos ingresados se ha perdido por limite de tiempo de sesión, por favor refresque la ventana y vuelva a intentarlo')", true);
            }
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "alert('Se presento un error al intentar generar la entrada los datos son erroneos, por favor refresque la ventana y vuelva a intentarlo')", true);
        }
    }
コード例 #26
0
    protected void lnkTerminar_Click(object sender, EventArgs e)
    {
        lblError.Text = "";
        try
        {
            LinkButton btn      = (LinkButton)sender;
            string     id       = btn.CommandArgument.ToString();
            Entradas   entradas = new Entradas();
            entradas.entrada = Convert.ToInt32(id);
            entradas.tienda  = Convert.ToInt32(RadGrid1.SelectedValues["id_punto"].ToString());
            entradas.terminarEntrada();
            if (Convert.ToBoolean(entradas.retorno[0]))
            {
                decimal monto        = 0;
                string  factura      = "";
                int     idProveedor  = 0;
                int     proveedor    = 0;
                string  rfc          = "";
                string  nombrePorvee = "";

                entradas.obtieneEncabezadoEntrada();
                object[] infoEnt = entradas.retorno;
                if (Convert.ToBoolean(infoEnt[0]))
                {
                    DataSet datos = (DataSet)infoEnt[1];
                    foreach (DataRow r in datos.Tables[0].Rows)
                    {
                        monto     = Convert.ToDecimal(r[8]);
                        factura   = Convert.ToString(r[2]);
                        proveedor = Convert.ToInt32(r[5]);
                        break;
                    }
                }
                Proveedores proveerod = new Proveedores();
                DataSet     infoProv  = proveerod.obtieneInfo(proveedor.ToString());
                foreach (DataRow r in infoProv.Tables[0].Rows)
                {
                    rfc          = Convert.ToString(r[2]).ToUpper().Trim();
                    nombrePorvee = Convert.ToString(r[3]).ToUpper().Trim();
                }

                CatClientes clientes = new CatClientes();



                lblError.Text = "Entrada Concluida Existosamente";
                Facturas facturas = new Facturas();
                facturas.folio      = Convert.ToInt32(id);
                facturas.tipoCuenta = "PA";
                facturas.factura    = factura;



                object[] existe = clientes.existeCliente(rfc);

                if (Convert.ToBoolean(existe[0]))
                {
                    if (!Convert.ToBoolean(existe[1]))
                    {
                        clientes.insertaClienteBasicos(rfc, nombrePorvee, "", "", "", true, "M", "1900-01-01", "P", "");
                    }
                }


                object[] info = clientes.obtieneIdProveedor(rfc);
                if (Convert.ToBoolean(info[0]))
                {
                    idProveedor = Convert.ToInt32(info[1]);
                }
                else
                {
                    idProveedor = 0;
                }

                if (idProveedor != 0)
                {
                    string politica = clientes.obtieneClavePolitica(Convert.ToDecimal(idProveedor));
                    facturas.id_cliprov   = Convert.ToInt32(idProveedor);
                    facturas.politica     = politica;
                    facturas.estatus      = "PEN";
                    facturas.empresa      = 1;
                    facturas.taller       = Convert.ToInt16(RadGrid1.SelectedValues["id_punto"]);
                    facturas.tipoCargo    = "C";
                    facturas.Importe      = monto;
                    facturas.montoPagar   = monto;
                    facturas.orden        = Convert.ToInt32(id);
                    facturas.razon_social = nombrePorvee.ToUpper().Trim();
                    facturas.monto        = monto;
                    facturas.existeFactura();
                    if (Convert.ToBoolean(facturas.retorno[0]))
                    {
                        if (Convert.ToInt32(facturas.retorno[1]) == 0)
                        {
                            facturas.generaFactura();
                        }
                    }
                }
                RadGrid2.Rebind();
            }
            else
            {
                lblError.Text = "Error al terminar la entrada. Detalle: " + Convert.ToString(entradas.retorno[1]);
            }
        }
        catch (Exception ex)
        {
            lblError.Text = "Error al terminar la entrada. Detalle: " + ex.Message;
        }
    }
コード例 #27
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     RadGrid2.DataSource = GetEmployee();
     RadGrid2.Rebind();
 }
コード例 #28
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     RadGrid2.DataSource = GetApprovingAutority();
     RadGrid2.Rebind();
 }
コード例 #29
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     RadGrid2.Rebind();
     //Button1.Visible = true;
 }
コード例 #30
0
 protected void RadGrid2_PreRender(object sender, EventArgs e)
 {
     //RadGrid2.MasterTableView.GetColumn("IDHang").Visible = false;
     RadGrid2.Rebind();
 }