Beispiel #1
0
 protected void NewRemito_Click(object sender, EventArgs e)
 {
     Data2.Class.Struct_Remito R = new Data2.Class.Struct_Remito(Conversion.ObtenerLocal(UserId));
     R.set_SUPPLIER(int.Parse(cmb_Providers.SelectedValue));
     Session.Add(RemitoString, R);
     redirectome();
 }
Beispiel #2
0
        protected void cmb_Providers_SelectedIndexChanged(object sender, EventArgs e)
        {
            Data2.Class.Struct_Remito R = Session[RemitoString] as Data2.Class.Struct_Remito;
            R.set_SUPPLIER(int.Parse(cmb_Providers.SelectedValue));

            Session.Remove(RemitoString);
            Session.Add(RemitoString, R);
        }
Beispiel #3
0
 void LoadProviders()
 {
     if (!IsPostBack)
     {
         DataTable DT = Data2.Connection.D_Supplier.Get_AllShort(Conversion.ObtenerLocal(UserId));
         cmb_Providers.Items.Clear();
         if (DT != null && DT.Rows.Count > 0)
         {
             foreach (DataRow D in DT.Rows)
             {
                 string nombreproveedor = D["Nombre"].ToString();
                 if (nombreproveedor == "")
                 {
                     nombreproveedor = D["NombreFantasía"].ToString();
                 }
                 System.Web.UI.WebControls.ListItem LI = new System.Web.UI.WebControls.ListItem(nombreproveedor, D["Id"].ToString());
                 cmb_Providers.Items.Add(LI);
             }
         }
         if (ObtenerRemito() != null && ObtenerRemito().get_SUPPLIER() != null)
         {
             int selectedindex            = 0;
             Data2.Class.Struct_Remito SR = ObtenerRemito();
             for (int a = 0; a < cmb_Providers.Items.Count; a++)
             {
                 if (ObtenerRemito().get_SUPPLIER().Id.ToString() == cmb_Providers.Items[a].Value)
                 {
                     selectedindex = a;
                     break;
                 }
             }
             cmb_Providers.SelectedIndex = selectedindex;
         }
     }
     else
     {
         if (ObtenerRemito() != null && ObtenerRemito().get_SUPPLIER() != null)
         {
             if (cmb_Providers.SelectedValue != ObtenerRemito().get_SUPPLIER().Id.ToString())
             {
                 Data2.Class.Struct_Remito SR = ObtenerRemito();
                 SR.ListaArticulos.Clear();
                 SR.set_SUPPLIER(int.Parse(cmb_Providers.SelectedValue));
             }
         }
     }
 }