Ejemplo n.º 1
0
 public override void Load(Dao.SuperDao dao)
 {
     //if (ReqAccount.Instance.Logout(AppSettings.Instance.Ticket).ret)
     //{
     //    AppSettings.Instance.Account = string.Empty;
     //    AppSettings.Instance.Ticket = string.Empty;
     //}
     //Ctrl.Init(null);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// データベースアクセスクラスを取得します。
        /// </summary>
        /// <param name="iInfo">情報インターフェース</param>
        /// <returns>データベースアクセスクラスのインスタンス</returns>
        protected Dao GetDbAccess(IInfo iInfo)
        {
            ConnectionStringSettings setting = iInfo.GetConnectionString();

            Dao db = new Dao(new DBLog(iInfo), setting);
            db.Connect();

            return db;
        }
Ejemplo n.º 3
0
 public void Show(UCFregments fregment, Dao.SuperDao dao)
 {
     ISuperBusiness next = _businesses.Find(b => b.Code == fregment);
     if (next == null) return;
     next.SetParent(_currentBusiness);
     _currentBusiness = next;
     _currentBusiness.Show();
     _currentBusiness.Load(dao);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Deserialize a Dao object
        /// </summary>
        /// <param name="node"></param>
        /// <param name="configScope"></param>
        /// <returns></returns>
        public static Dao Deserialize(XmlNode node, ConfigurationScope configScope)
        {
            Dao dao = new Dao();

            NameValueCollection prop = NodeUtils.ParseAttributes(node, configScope.Properties);
            dao.Implementation = NodeUtils.GetStringAttribute(prop, "implementation");
            dao.Interface = NodeUtils.GetStringAttribute(prop, "interface");

            return dao;
        }
Ejemplo n.º 5
0
 public override void Init(Dao.SuperDao dao)
 {
     if (dao != null)
     {
         base.Init(dao);
         chattingwith = dao as Contact;
         lvChatting.SetContact(chattingwith);
         this.lbChattingFriend.Text = chattingwith.Name;
         this.lbChattingFriend.Tag = chattingwith.Account;
     }
     lvChatting.Clear();
 }
Ejemplo n.º 6
0
        private void BunifuThinButton23_Click(object sender, EventArgs e)
        {
            label15.Text = "data not selected yet";
            label22.Text = "data not selected yet";
            label23.Text = "data not selected yet";
            label24.Text = "data not selected yet";
            label25.Text = "data not selected yet";
            label26.Text = "data not selected yet";
            bunifuGradientPanel2.Hide();
            bunifuGradientPanel1.Show();


            {
                if (comboBox2.Text == "DeputyGenaralManager" || comboBox2.Text == "GenaralManager")
                {
                    Manager man = new Manager()
                    {
                        Id            = textBox1.Text,
                        Department    = comboBox1.Text,
                        Designation   = comboBox2.Text,
                        Telephone     = textBox2.Text,
                        Email         = textBox3.Text,
                        Address       = textBox4.Text,
                        Mobile        = textBox5.Text,
                        NumberOfChild = textBox6.Text
                    };

                    Dao ca = new Dao();
                    ca.Connect();
                    ca.UpdateManager(man);


                    MessageBox.Show("success fully updated employee");
                    textBox1.Text  = "";
                    textBox2.Text  = "";
                    textBox3.Text  = "";
                    textBox4.Text  = "";
                    textBox5.Text  = "";
                    textBox6.Text  = "";
                    comboBox2.Text = "";
                    comboBox1.Text = "";



                    ca.Disconnect();
                    loadMTable();
                }
                else
                {
                    Employee em = new Employee()
                    {
                        Id            = textBox1.Text,
                        Department    = comboBox1.Text,
                        Designation   = comboBox2.Text,
                        Telephone     = textBox2.Text,
                        Email         = textBox3.Text,
                        Address       = textBox4.Text,
                        Mobile        = textBox5.Text,
                        NumberOfChild = textBox6.Text
                    };

                    Dao cs = new Dao();
                    cs.Connect();
                    cs.UpdateEmployee(em);
                    MessageBox.Show("success fully updated employee");
                    textBox1.Text = "";
                    textBox2.Text = "";
                    textBox3.Text = "";
                    textBox4.Text = "";
                    textBox5.Text = "";
                    textBox6.Text = "";
                    loadTable();
                }
            }
        }
Ejemplo n.º 7
0
        private void BunifuThinButton21_Click(object sender, EventArgs e)
        {
            bunifuGradientPanel1.Show();
            label4.Hide();
            textBox1.Hide();
            if (comboBox2.Text == "DeputyGenaralManager" || comboBox2.Text == "GenaralManager")
            {
                label4.Show();
                textBox1.Show();
                Manager man = new Manager()
                {
                    Id          = textBox1.Text,
                    Designation = comboBox2.Text
                };

                Dao cs = new Dao();
                cs.Connect();
                cs.FindManager(man);


                comboBox1.Text = man.Department;
                comboBox2.Text = man.Designation;
                textBox2.Text  = man.Telephone;
                textBox3.Text  = man.Email;
                textBox4.Text  = man.Address;
                textBox5.Text  = man.Mobile;
                textBox6.Text  = man.NumberOfChild;


                label15.Text = "data not selected yet";
                label22.Text = "data not selected yet";
                label23.Text = "data not selected yet";
                label24.Text = "data not selected yet";
                label25.Text = "data not selected yet";
                label26.Text = "data not selected yet";

                cs.Disconnect();
                loadMTable();
            }
            else
            {
                Employee em = new Employee()
                {
                    Id          = textBox1.Text,
                    Designation = comboBox2.Text
                };
                Dao cs = new Dao();
                cs.Connect();
                cs.FindEmployee(em);


                label15.Text = "data not selected yet";
                label22.Text = "data not selected yet";
                label23.Text = "data not selected yet";
                label24.Text = "data not selected yet";
                label25.Text = "data not selected yet";
                label26.Text = "data not selected yet";

                //comboBox1.Text = em.Department;
                //comboBox2.Text = em.Designation;
                //textBox2.Text = em.Telephone;
                //textBox3.Text = em.Email;
                //textBox4.Text = em.Address;
                //textBox5.Text = em.Mobile;
                //textBox6.Text = em.NumberOfChild;
                cs.Disconnect();
                loadTable();
            }
        }
Ejemplo n.º 8
0
 public ManterArquivoResponsavel()
 {
     oDao = new Dao();
 }
Ejemplo n.º 9
0
 public TimerCollection(DataTable table, Dao dao = null, string rc = null) : base(table, dao, rc)
 {
 }
Ejemplo n.º 10
0
 public AppAction GetActionById(int appActionId)
 {
     return(Dao.Single <AppAction>(x => x.Id == appActionId));
 }
Ejemplo n.º 11
0
 public TesteAsc(Dao dado)
 {
     data = dado;
 }
 protected AbstractEventRepository(Dao <EventEntity> dao, SegmentDao segmentDao) : base(dao)
 {
     _segmentDao = segmentDao;
 }
Ejemplo n.º 13
0
 public IEnumerable <PaymentType> GetPaymentTypes()
 {
     return(Dao.Query <PaymentType>(x => x.PaymentTypeMaps, x => x.AccountTransactionType, x => x.Account));
 }
Ejemplo n.º 14
0
 public IEnumerable <PrintJob> GetPrintJobs()
 {
     return(Dao.Query <PrintJob>(x => x.PrinterMaps));
 }
Ejemplo n.º 15
0
 public IEnumerable <State> GetStates()
 {
     return(Dao.Query <State>());
 }
Ejemplo n.º 16
0
 public IEnumerable <AccountTransactionDocumentType> GetAccountTransactionDocumentTypes()
 {
     return(Dao.Query <AccountTransactionDocumentType>(x => x.TransactionTypes, x => x.AccountTransactionDocumentTypeMaps, x => x.AccountTransactionDocumentAccountMaps));
 }
Ejemplo n.º 17
0
 public IEnumerable <AccountType> GetAccountTypes()
 {
     return(Dao.Query <AccountType>().OrderBy(x => x.SortOrder));
 }
Ejemplo n.º 18
0
 protected virtual void Execute(COM.TIGER.TASK.DAT.Synchronization.Dao.DataHandler dbFrom, Dao.DataHandler dbTarget, string dataFromCmdString)
 {
 }
Ejemplo n.º 19
0
 public Eixo(Dao dao)
 {
     oDao = dao;
 }
Ejemplo n.º 20
0
 public IEnumerable <Entity> GetEntities(int entityTypeId)
 {
     return(Dao.Query <Entity>(x => x.EntityTypeId == entityTypeId));
 }
Ejemplo n.º 21
0
 public static LoadBillReconciliation GetByLoadBillNum(string loadBillNum)
 {
     return(Dao.GetByLoadBillNum(loadBillNum));
 }
Ejemplo n.º 22
0
 public IEnumerable <string> GetAutomationCommandNames()
 {
     return(Dao.Distinct <AutomationCommand>(x => x.Name));
 }
Ejemplo n.º 23
0
 public static IPageOfList <LoadBillReconciliation> GetByMonthPayOffFilter(ParameterFilter filter)
 {
     return(Dao.GetByMonthPayOffFilter(filter));
 }
Ejemplo n.º 24
0
 public TimerCollection(Query <TimerColumns, Timer> q, Dao dao = null, string rc = null) : base(q, dao, rc)
 {
 }
Ejemplo n.º 25
0
 public static IPageOfList <LoadBillReconciliation> GetByMonthPayOffExportFilter(LBRForMonthPayOffExportFilter filter)
 {
     return(Dao.GetByMonthPayOffFilter(filter));
 }
Ejemplo n.º 26
0
 public ManterArquivoResponsavel(string connectionString, DataBaseTypes dataBaseType)
 {
     oDao = new Dao(connectionString, dataBaseType);
 }
Ejemplo n.º 27
0
 public SettingCollection(Database db, DataTable table, Dao dao = null, string rc = null) : base(db, table, dao, rc)
 {
 }
Ejemplo n.º 28
0
        private void BunifuThinButton22_Click(object sender, EventArgs e)
        {
            if (comboBox2.Text == "DeputyGenaralManager" || comboBox2.Text == "GenaralManager")
            {
                Manager man = new Manager()
                {
                    Id = textBox1.Text,
                };

                Dao cs = new Dao();
                cs.Connect();
                cs.RemoveManager(man);
                MessageBox.Show("success fully removed employee");
                textBox1.Text  = "";
                textBox2.Text  = "";
                textBox3.Text  = "";
                textBox4.Text  = "";
                textBox5.Text  = "";
                textBox6.Text  = "";
                comboBox2.Text = "";
                comboBox1.Text = "";

                label15.Text = "data removed";
                label22.Text = "data removed";
                label23.Text = "data removed";
                label24.Text = "data removed";
                label25.Text = "data removed";
                label26.Text = "data removed";

                loadMTable();
            }
            else
            {
                Employee em = new Employee()
                {
                    Id = textBox1.Text,
                };

                Dao cs = new Dao();
                cs.Connect();
                cs.RemoveEmployee(em);
                MessageBox.Show("success fully removed employee");
                textBox1.Text  = "";
                textBox2.Text  = "";
                textBox3.Text  = "";
                textBox4.Text  = "";
                textBox5.Text  = "";
                textBox6.Text  = "";
                comboBox2.Text = "";
                comboBox1.Text = "";

                label15.Text = "data removed";
                label22.Text = "data removed";
                label23.Text = "data removed";
                label24.Text = "data removed";
                label25.Text = "data removed";
                label26.Text = "data removed";


                loadTable();
            }
        }
Ejemplo n.º 29
0
 public SettingCollection(Query <SettingColumns, Setting> q, Dao dao = null, string rc = null) : base(q, dao, rc)
 {
 }
Ejemplo n.º 30
0
        public static void UpdateCollectionsForTitle(Dao.Title title)
        {
            if (title.UpdatedActors != null)
            {
                IEnumerable<string> originalActors = from a in title.People
                                                     where a.Role == (byte)PeopleRole.Actor
                                                     select a.MetaData.FullName;

                List<string> added = new List<string>(title.UpdatedActors.Where(t => !originalActors.Contains(t.PersonName)).Select(t => t.PersonName));
                List<string> removed = new List<string>(originalActors.Where(t => !title.UpdatedActors.Select(r => r.PersonName).Contains(t)));

                // remove ones no longer used
                foreach (string remove in removed)
                {
                    Dao.Person person = title.People.SingleOrDefault(p => p.MetaData.FullName == remove && p.Role == (byte)PeopleRole.Actor);

                    if (person != null)
                        title.People.Remove(person);
                }

                Dictionary<string, string> actorLookup = new Dictionary<string, string>();
                title.UpdatedActors.ForEach(t => actorLookup.Add(t.PersonName, t.RoleName));

                // add the new ones
                foreach (string add in added)
                {
                    AddActorToTitle(title, add, actorLookup[add], PeopleRole.Actor);
                }
            }

            if (title.UpdatedDirectors != null)
            {
                ProcessPersonList(title, title.UpdatedDirectors, PeopleRole.Director);
            }

            if (title.UpdatedWriters != null)
            {
                ProcessPersonList(title, title.UpdatedWriters, PeopleRole.Writer);
            }

            if (title.UpdatedProducers != null)
            {
                ProcessPersonList(title, title.UpdatedProducers, PeopleRole.Producers);
            }

            // if the genres were modified see how they've changed
            if (title.UpdatedGenres != null)
            {
                // see if there are any genres to add

                // grab all the original genres
                IEnumerable<string> originalGenres = from g in title.Genres
                                                     select g.MetaData.Name;

                List<string> added = new List<string>(title.UpdatedGenres.Where(t => !originalGenres.Contains(t)));
                List<string> removed = new List<string>(originalGenres.Where(t => !title.UpdatedGenres.Contains(t)));

                // remove ones no longer used
                foreach (string remove in removed)
                {
                    Dao.Genre genre = title.Genres.SingleOrDefault(g => g.MetaData.Name == remove);

                    if (genre != null)
                        title.Genres.Remove(genre);
                }

                // add the new ones
                foreach (string add in added)
                {
                    AddGenreToTitle(title, add);
                }
            }

            if (title.UpdatedTags != null)
            {
                IEnumerable<string> originalTags = from t in title.Tags
                                                   select t.Name;

                List<string> added = new List<string>(title.UpdatedTags.Where(t => !originalTags.Contains(t)));
                List<string> removed = new List<string>(originalTags.Where(t => !title.UpdatedTags.Contains(t)));

                foreach (string remove in removed)
                {
                    Dao.Tag tag = title.Tags.SingleOrDefault(t => t.Name == remove);

                    if (tag != null)
                        title.Tags.Remove(tag);
                }

                foreach (string add in added)
                {
                    Dao.Tag daoTag = new OMLEngine.Dao.Tag();
                    daoTag.TitleId = title.Id;
                    daoTag.Name = add;

                    title.Tags.Add(daoTag);
                }
            }
        }
Ejemplo n.º 31
0
        /// <summary>
        /// Adds a genre to a title
        /// </summary>
        /// <param name="title"></param>
        /// <param name="genre"></param>
        private static void AddGenreToTitle(Dao.Title title, string genre)
        {
            if (string.IsNullOrEmpty(genre))
                return;

            // see if the genre exists
            Dao.GenreMetaData meta = Dao.TitleCollectionDao.GetGenreMetaDataByName(genre);

            if (meta == null)
            {
                meta = new OMLEngine.Dao.GenreMetaData();
                meta.Name = genre;

                // save the genre
                Dao.DBContext.Instance.GenreMetaDatas.InsertOnSubmit(meta);
            }

            title.Genres.Add(new Dao.Genre { MetaData = meta });
        }
Ejemplo n.º 32
0
 public Account GetAccountById(int accountId)
 {
     return(Dao.SingleWithCache <Account>(x => x.Id == accountId));
 }
Ejemplo n.º 33
0
 public IEnumerable <EntityType> GetEntityTypes()
 {
     return(Dao.Query <EntityType>(x => x.EntityCustomFields).OrderBy(x => x.SortOrder));
 }
Ejemplo n.º 34
0
        private static void AddActorToTitle(Dao.Title title, string actor, string role, PeopleRole type)
        {
            if (actor.Length > 255)
                throw new FormatException("Actor must be 255 characters or less.");
            if (role != null && role.Length > 255)
                throw new FormatException("Role must be 255 characters or less.");

            if (string.IsNullOrEmpty(actor))
                return;

            Dao.BioData bioData = Dao.TitleCollectionDao.GetPersonBioDataByName(actor);

            if (bioData == null)
            {
                bioData = new OMLEngine.Dao.BioData();
                bioData.FullName = actor;
                Dao.DBContext.Instance.BioDatas.InsertOnSubmit(bioData);
                Dao.DBContext.Instance.SubmitChanges();
            }

            Dao.Person person = new OMLEngine.Dao.Person();
            person.MetaData = bioData;
            person.CharacterName = role;
            person.Role = (byte)type;
            title.People.Add(person);
        }
Ejemplo n.º 35
0
 public Entity GetEntityById(int accountId)
 {
     return(Dao.SingleWithCache <Entity>(x => x.Id == accountId));
 }
Ejemplo n.º 36
0
        private static void ProcessPersonList(Dao.Title title, List<OMLEngine.Person> updatedList, PeopleRole role)
        {
            IEnumerable<string> originals = from a in title.People
                                                  where a.Role == (byte)role
                                                  select a.MetaData.FullName;

            List<string> added = new List<string>(updatedList.Where(t => !originals.Contains(t.full_name)).Select(t => t.full_name));
            List<string> removed = new List<string>(originals.Where(t => !updatedList.Select(r => r.full_name).Contains(t)));

            // remove ones no longer used
            foreach (string remove in removed)
            {
                Dao.Person person = title.People.SingleOrDefault(p => p.MetaData.FullName == remove && p.Role == (byte)role);

                if (person != null)
                    title.People.Remove(person);
            }

            // add the new ones
            foreach (string add in added)
            {
                if (!string.IsNullOrEmpty(add))
                {
                    AddActorToTitle(title, add, null, role);
                }
            }
        }
Ejemplo n.º 37
0
 protected ApiControllerBase(ISessionFactory sessionFactory)
 {
     dao = new Dao(sessionFactory);
 }
Ejemplo n.º 38
0
 internal Disk(Dao.Disk disk)
 {
     _disk = disk;
 }
Ejemplo n.º 39
0
 public AutomationDao()
 {
     ValidatorRegistry.RegisterDeleteValidator <AppAction>(x => Dao.Exists <ActionContainer>(y => y.AppActionId == x.Id), Resources.Action, Resources.Rule);
 }
Ejemplo n.º 40
0
 public Dictionary <string, string> GetScripts()
 {
     return(Dao.Query <Script>().ToDictionary(x => x.HandlerName, x => x.Code));
 }
Ejemplo n.º 41
0
 public IEnumerable <AccountTransactionType> GetAccountTransactionTypes()
 {
     return(Dao.Query <AccountTransactionType>());
 }