Ejemplo n.º 1
0
 private void button2_Click(object sender, EventArgs e)
 {
     using (AddAuther ac = new AddAuther())
     {
         ac.ShowDialog();
     }
 }
Ejemplo n.º 2
0
        public AddAuther GetAuthweByName(string Auther)
        {
            AddAuther x      = new AddAuther();
            var       auther = context.Authers.FirstOrDefault(ww => ww.Name == Auther);

            x.AutherImage    = auther.AutherImage;
            x.JobDescribtion = auther.JobDescribtion;
            x.Name           = auther.Name;
            return(x);
        }
Ejemplo n.º 3
0
        public int PostForAddAuther(AddAuther auther1)
        {
            var chackAutherName = context.Authers.FirstOrDefault(ww => ww.Name == auther1.Name);

            if (chackAutherName == null)
            {
                Auther auther = new Auther();
                auther.Name           = auther1.Name;
                auther.AutherImage    = auther1.AutherImage;
                auther.JobDescribtion = auther1.JobDescribtion;
                context.Authers.Add(auther);
                context.SaveChanges();
                return(1);
            }
            else
            {
                return(0);
            }
        }