コード例 #1
0
        protected void BtnSave_Click(object sender, EventArgs e)
        {
            if (DpSeccion.SelectedItem != null)
            {
                MTerritorial NewTerritorial = new MTerritorial(Int32.Parse(DpCoor.SelectedItem.Value), TxtLastName.Text, TxtMiddleName.Text, TxtNames.Text, Int32.Parse(DpSeccion.SelectedItem.Value)
                                                               , TxtStret.Text, TxtColony.Text, TxtEmail.Text, TxtPhoneHome.Text, TxtPhoneOffice.Text, TxtPhoneNextel.Text, TxtElector.Text);
                Saved = C.SaveTerritorial(NewTerritorial);
                ReloadIntegrantsTable();

                if (Saved == true)
                {
                    Clear();
                }
            }
        }
コード例 #2
0
ファイル: CIntegrantes.cs プロジェクト: CarlosMillan/Networks
        public bool SaveTerritorial(MTerritorial terr)
        {
            bool Saved = false;

            try
            {
                if (!String.IsNullOrEmpty(terr.Paterno) && !String.IsNullOrEmpty(terr.Materno) && !String.IsNullOrEmpty(terr.Nombres))
                {
                    DBManager     DB             = new DBManager(ConfigurationManager.AppSettings["SQLiteDB"]);
                    StringBuilder WhereStatement = new StringBuilder();
                    WhereStatement.AppendFormat(@"ApellidoPaterno like {0}
                                              and ApellidoMaterno like {1}
                                              and Nombres like {2}"
                                                , Extensions.SParam(terr.Paterno)
                                                , Extensions.SParam(terr.Materno)
                                                , Extensions.SParam(terr.Nombres));
                    object ID = DB.GetValue("Territorial", IntegrantsColumns.Id, WhereStatement.ToString());

                    if (ID == null)
                    {
                        DB.Insert("Territorial", new object[] { IntegrantsColumns.Id, "null"
                                                                , IntegrantsColumns.Coordinador, terr.CoordinadorId
                                                                , IntegrantsColumns.Paterno, Extensions.SParam(terr.Paterno)
                                                                , IntegrantsColumns.Materno, Extensions.SParam(terr.Materno)
                                                                , IntegrantsColumns.Nombres, Extensions.SParam(terr.Nombres)
                                                                , IntegrantsColumns.Seccion, terr.Seccion
                                                                , IntegrantsColumns.Calle, Extensions.SParam(terr.Calle)
                                                                , IntegrantsColumns.Colonia, Extensions.SParam(terr.Colonia)
                                                                , IntegrantsColumns.Email, Extensions.SParam(terr.Email)
                                                                , IntegrantsColumns.TelefonoDomicilio, Extensions.SParam(terr.Domicilio)
                                                                , IntegrantsColumns.TelefonoOficina, Extensions.SParam(terr.Oficina)
                                                                , IntegrantsColumns.TelefonoNextel, Extensions.SParam(terr.Nextel)
                                                                , IntegrantsColumns.ClaveElector, Extensions.SParam(terr.Elector) });
                        Saved = true;
                    }
                }
            }
            catch (Exception E)
            {
                throw E;
            }

            return(Saved);
        }