Пример #1
0
        public void DeleteContactInfo(int id)
        {
            SqlCommand cmd = new SqlCommand("Delete From contact_info Where id=@Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            contactInfo(cmd);
        }
Пример #2
0
        public void DeleteUniform(int id)
        {
            SqlCommand cmd = new SqlCommand("Delete From uniform Where id=@Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            uniform(cmd);
        }
        public void DeleteEvent(int id)
        {
            SqlCommand cmd = new SqlCommand("Delete From events Where id=@Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            event_(cmd);
        }
        public void DeleteBook(int id)
        {
            SqlCommand cmd = new SqlCommand("Delete From books Where id=@Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            book(cmd);
        }
Пример #5
0
        public void DeleteClassLvl(int id)
        {
            SqlCommand cmd = new SqlCommand("Delete From class_levels Where id=@Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            classlevel(cmd);
        }
Пример #6
0
        public StuffsInStorages SelectById(int id)
        {
            SqlCommand cmd = new SqlCommand("Select * from storage where Id=@Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            List <StuffsInStorages> temp = fetchStuffsInStorages(cmd);

            return((temp != null) ? temp[0] : null);
        }
        public Results SelectResultTitleById(int mrid)
        {
            SqlCommand cmd = new SqlCommand("Select * from results where id=@Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", mrid);
            List <Results> temp = fetchSubjectsResult(cmd);

            return((temp != null) ? temp[0] : null);
        }
Пример #8
0
        public Employees SelectById(int id)
        {
            SqlCommand cmd = new SqlCommand("Select * from employees where Id=@Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            List <Employees> temp = fetchEmployees(cmd);

            return((temp != null) ? temp[0] : null);
        }
Пример #9
0
        public List <Employees> SelectBySearch(string Search_key)
        {
            SqlCommand cmd = new SqlCommand("Select * from employees where name=@Search", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Search", Search_key);
            return(fetchEmployees(cmd));
        }
Пример #10
0
        public List <Employees> SelectAllEmployees()
        {
            SqlCommand cmd = new SqlCommand("Select * from employees order by id", DALUtil.getConnection());

            return(fetchEmployees(cmd));
        }
        public List <Syllabuses> SelectBySearch(string Search_key)
        {
            SqlCommand cmd = new SqlCommand("Select * from syllabus where name_of_lvl=@Search", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Search", Search_key);
            return(fetchSyllabuses(cmd));
        }
Пример #12
0
        public ContactsInfo SelectById(int id)
        {
            SqlCommand cmd = new SqlCommand("Select * from contact_info where Id=@Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            List <ContactsInfo> temp = fetchContactsInfo(cmd);

            return((temp != null) ? temp[0] : null);
        }
Пример #13
0
        public void UpdateClassLevel(ClassLevels cl, int id)
        {
            SqlCommand cmd = new SqlCommand("UPDATE class_levels set name=@Name , range=@Range Where id=@Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            cmd.Parameters.AddWithValue("@Name", (cl.Name == null) ? Convert.DBNull : cl.Name);
            cmd.Parameters.AddWithValue("@Range", (cl.Range == null) ? Convert.DBNull : cl.Range);
            classlevel(cmd);
        }
Пример #14
0
        public List <ContactsInfo> SelectAllContactsInfo()
        {
            SqlCommand cmd = new SqlCommand("Select * from contact_info order by id", DALUtil.getConnection());

            return(fetchContactsInfo(cmd));
        }
Пример #15
0
        public void UpdateContactInfo(ContactsInfo uci, int id)
        {
            SqlCommand cmd = new SqlCommand("Update contact_info Set title=@Title , contact_c=@Contact_C , contact_p=@Contact_P , contact_e=@Contact_E , contact_w=@Contact_W , contact_l=@Contact_L , contact_a=@Contact_A Where id = @Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            cmd.Parameters.AddWithValue("@Title", (uci.Title == null) ? Convert.DBNull : uci.Title);
            cmd.Parameters.AddWithValue("@Contact_C", (uci.Contact_Cell == null) ? Convert.DBNull : uci.Contact_Cell);
            cmd.Parameters.AddWithValue("@Contact_P", (uci.Contact_Phone == null) ? Convert.DBNull : uci.Contact_Phone);
            cmd.Parameters.AddWithValue("@Contact_E", (uci.Contact_Email == null) ? Convert.DBNull : uci.Contact_Email);
            cmd.Parameters.AddWithValue("@Contact_W", (uci.Contact_Website == null) ? Convert.DBNull : uci.Contact_Website);
            cmd.Parameters.AddWithValue("@Contact_L", (uci.Contact_Location == null) ? Convert.DBNull : uci.Contact_Location);
            cmd.Parameters.AddWithValue("@Contact_A", (uci.Contact_Address == null) ? Convert.DBNull : uci.Contact_Address);
            contactInfo(cmd);
        }
Пример #16
0
        public void UpdateAchvmnt_img(Achvmnts ua, int id)
        {
            SqlCommand cmd = new SqlCommand("Update achievements Set name=@Name,detail=@Detail,picture=@Picture Where id=@Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            cmd.Parameters.AddWithValue("@Name", (ua.Name == null) ? Convert.DBNull : ua.Name);
            cmd.Parameters.AddWithValue("@Detail", (ua.Detail == null) ? Convert.DBNull : ua.Detail);
            cmd.Parameters.AddWithValue("@Picture", (ua.Picture == null) ? Convert.DBNull : ua.Picture);
            addachvmnt(cmd);
        }
Пример #17
0
        public void AddAchvmnt(Achvmnts a)
        {
            SqlCommand cmd = new SqlCommand("INSERT into achievements (name,detail,picture,date,month,year,time) VALUES (@Name,@Detail,@Picture,@Date,@Month,@Year,@Time)", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Name", (a.Name == null) ? Convert.DBNull : a.Name);
            cmd.Parameters.AddWithValue("@Detail", (a.Detail == null) ? Convert.DBNull : a.Detail);
            cmd.Parameters.AddWithValue("@Picture", (a.Picture == null) ? Convert.DBNull : a.Picture);
            cmd.Parameters.AddWithValue("@Date", (a.Date == null) ? Convert.DBNull : a.Date);
            cmd.Parameters.AddWithValue("@Month", (a.Month == null) ? Convert.DBNull : a.Month);
            cmd.Parameters.AddWithValue("@Year", (a.Year == null) ? Convert.DBNull : a.Year);
            cmd.Parameters.AddWithValue("@Time", (a.Time == null) ? Convert.DBNull : a.Time);
            addachvmnt(cmd);
        }
        public List <GradesSections> SelectAllActive(int id)
        {
            SqlCommand cmd = new SqlCommand("Select * from gradesections where publish = '2' order by id desc", DALUtil.getConnection());

            return(fetchSection(cmd));
        }
        public List <GradesSections> SelectAll(int id)
        {
            SqlCommand cmd = new SqlCommand("Select * from gradesections where class_level_id=@Id order by id desc", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            return(fetchSection(cmd));
        }
        public Events SelectByIdForWeb(int?id)
        {
            SqlCommand cmd = new SqlCommand("Select * from events where Id=@Id and publish = '2'", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            List <Events> temp = fetchEvents(cmd);

            return((temp != null) ? temp[0] : null);
        }
        public List <Events> SelectAllEventsForWeb()
        {
            SqlCommand cmd = new SqlCommand("Select * from events where publish = '2' order by id", DALUtil.getConnection());

            return(fetchEvents(cmd));
        }
Пример #22
0
        public ContactsInfo SelectContactInfoForWeb()
        {
            SqlCommand          cmd  = new SqlCommand("Select * from contact_info where publish = '2' order by id", DALUtil.getConnection());
            List <ContactsInfo> temp = fetchContactsInfo(cmd);

            return((temp != null) ? temp[0] : null);
        }
Пример #23
0
        public void AddContactInfo(ContactsInfo ci)
        {
            SqlCommand cmd = new SqlCommand("INSERT into contact_info (title,contact_c,contact_p,contact_e,contact_w,contact_l,contact_a,date,month,year,time) VALUES (@Title,@Contact_C,@Contact_P,@Contact_E,@Contact_W,@Contact_L,@Contact_A,@Date,@Month,@Year,@Time)", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Title", (ci.Title == null) ? Convert.DBNull : ci.Title);
            cmd.Parameters.AddWithValue("@Contact_C", (ci.Contact_Cell == null) ? Convert.DBNull : ci.Contact_Cell);
            cmd.Parameters.AddWithValue("@Contact_P", (ci.Contact_Phone == null) ? Convert.DBNull : ci.Contact_Phone);
            cmd.Parameters.AddWithValue("@Contact_E", (ci.Contact_Email == null) ? Convert.DBNull : ci.Contact_Email);
            cmd.Parameters.AddWithValue("@Contact_W", (ci.Contact_Website == null) ? Convert.DBNull : ci.Contact_Website);
            cmd.Parameters.AddWithValue("@Contact_L", (ci.Contact_Location == null) ? Convert.DBNull : ci.Contact_Location);
            cmd.Parameters.AddWithValue("@Contact_A", (ci.Contact_Address == null) ? Convert.DBNull : ci.Contact_Address);
            cmd.Parameters.AddWithValue("@Date", (ci.Date == null) ? Convert.DBNull : ci.Date);
            cmd.Parameters.AddWithValue("@Month", (ci.Month == null) ? Convert.DBNull : ci.Month);
            cmd.Parameters.AddWithValue("@Year", (ci.Year == null) ? Convert.DBNull : ci.Year);
            cmd.Parameters.AddWithValue("@Time", (ci.Time == null) ? Convert.DBNull : ci.Time);
            contactInfo(cmd);
        }
Пример #24
0
        public void AddEmployee(Employees e)
        {
            SqlCommand cmd = new SqlCommand("INSERT into employees (e_id,name,dob,cnic,gender,email,contact,alt_contact,desig,gurdian_name,gurdian_cnic,addr,date,month,year,time) VALUES (@E_id,@Name,@Dob,@Cnic,@Gender,@Email,@Contact,@Alt_contact,@Desig,@G_name,@G_cnic,@Addr,@Date,@Month,@Year,@Time)", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@E_id", (e.E_Id == null) ? Convert.DBNull : e.E_Id);
            cmd.Parameters.AddWithValue("@Name", (e.E_name == null) ? Convert.DBNull : e.E_name);
            cmd.Parameters.AddWithValue("@Dob", (e.E_dob == null) ? Convert.DBNull : e.E_dob);
            cmd.Parameters.AddWithValue("@Cnic", (e.E_cnic == null) ? Convert.DBNull : e.E_cnic);
            cmd.Parameters.AddWithValue("@Gender", (e.E_gen == null) ? Convert.DBNull : e.E_gen);
            cmd.Parameters.AddWithValue("@Email", (e.E_email == null) ? Convert.DBNull : e.E_email);
            cmd.Parameters.AddWithValue("@Contact", (e.E_c_num == null) ? Convert.DBNull : e.E_c_num);
            cmd.Parameters.AddWithValue("@Alt_contact", (e.E_a_c_num == null) ? Convert.DBNull : e.E_a_c_num);
            cmd.Parameters.AddWithValue("@Desig", (e.E_desig == null) ? Convert.DBNull : e.E_desig);
            cmd.Parameters.AddWithValue("@G_name", (e.E_g_name == null) ? Convert.DBNull : e.E_g_name);
            cmd.Parameters.AddWithValue("@G_cnic", (e.E_g_cnic == null) ? Convert.DBNull : e.E_g_cnic);
            cmd.Parameters.AddWithValue("@Addr", (e.E_res_addr == null) ? Convert.DBNull : e.E_res_addr);
            cmd.Parameters.AddWithValue("@Date", (e.Date == null) ? Convert.DBNull : e.Date);
            cmd.Parameters.AddWithValue("@Month", (e.Month == null) ? Convert.DBNull : e.Month);
            cmd.Parameters.AddWithValue("@Year", (e.Year == null) ? Convert.DBNull : e.Year);
            cmd.Parameters.AddWithValue("@Time", (e.Time == null) ? Convert.DBNull : e.Time);
            addemployee(cmd);
        }
Пример #25
0
        public void PublishContactInfo(ContactsInfo pci, int id)
        {
            SqlCommand cmd = new SqlCommand("Update contact_info Set publish=@Publish Where id = @Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            cmd.Parameters.AddWithValue("@Publish", (pci.Publish == null) ? Convert.DBNull : pci.Publish);
            contactInfo(cmd);
        }
Пример #26
0
        public void UpdateEmployee(Employees ue, int id)
        {
            SqlCommand cmd = new SqlCommand("Update employees Set e_id=@E_id,name=@Name,dob=@Dob,cnic=@Cnic,gender=@Gender,email=@Email,contact=@Contact,alt_contact=@Alt_contact,desig=@Desig,gurdian_name=@G_name,gurdian_cnic=@G_cnic,addr=@Addr Where id=@Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            cmd.Parameters.AddWithValue("@E_id", (ue.E_Id == null) ? Convert.DBNull : ue.E_Id);
            cmd.Parameters.AddWithValue("@Name", (ue.E_name == null) ? Convert.DBNull : ue.E_name);
            cmd.Parameters.AddWithValue("@Dob", (ue.E_dob == null) ? Convert.DBNull : ue.E_dob);
            cmd.Parameters.AddWithValue("@Cnic", (ue.E_cnic == null) ? Convert.DBNull : ue.E_cnic);
            cmd.Parameters.AddWithValue("@Gender", (ue.E_gen == null) ? Convert.DBNull : ue.E_gen);
            cmd.Parameters.AddWithValue("@Email", (ue.E_email == null) ? Convert.DBNull : ue.E_email);
            cmd.Parameters.AddWithValue("@Contact", (ue.E_c_num == null) ? Convert.DBNull : ue.E_c_num);
            cmd.Parameters.AddWithValue("@Alt_contact", (ue.E_a_c_num == null) ? Convert.DBNull : ue.E_a_c_num);
            cmd.Parameters.AddWithValue("@Desig", (ue.E_desig == null) ? Convert.DBNull : ue.E_desig);
            cmd.Parameters.AddWithValue("@G_name", (ue.E_g_name == null) ? Convert.DBNull : ue.E_g_name);
            cmd.Parameters.AddWithValue("@G_cnic", (ue.E_g_cnic == null) ? Convert.DBNull : ue.E_g_cnic);
            cmd.Parameters.AddWithValue("@Addr", (ue.E_res_addr == null) ? Convert.DBNull : ue.E_res_addr);
            addemployee(cmd);
        }
Пример #27
0
        public void AddClassLevel(ClassLevels cl)
        {
            SqlCommand cmd = new SqlCommand("INSERT into class_levels (name,range,date,month,year,time) VALUES (@Name,@Range,@Date,@Month,@Year,@Time)", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Name", (cl.Name == null) ? Convert.DBNull : cl.Name);
            cmd.Parameters.AddWithValue("@Range", (cl.Range == null) ? Convert.DBNull : cl.Range);
            cmd.Parameters.AddWithValue("@Date", (cl.Date == null) ? Convert.DBNull : cl.Date);
            cmd.Parameters.AddWithValue("@Month", (cl.Month == null) ? Convert.DBNull : cl.Month);
            cmd.Parameters.AddWithValue("@Year", (cl.Year == null) ? Convert.DBNull : cl.Year);
            cmd.Parameters.AddWithValue("@Time", (cl.Time == null) ? Convert.DBNull : cl.Time);
            classlevel(cmd);
        }
        public List <Syllabuses> SelectAllSyllabuses()
        {
            SqlCommand cmd = new SqlCommand("Select * from syllabus order by id", DALUtil.getConnection());

            return(fetchSyllabuses(cmd));
        }
Пример #29
0
        public void PublishAchvmnt(Achvmnts pa, int id)
        {
            SqlCommand cmd = new SqlCommand("Update achievements Set publish=@Publish Where id = @Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            cmd.Parameters.AddWithValue("@Publish", (pa.Publish == null) ? Convert.DBNull : pa.Publish);
            addachvmnt(cmd);
        }
Пример #30
0
        public List <ContactsInfo> SelectBySearch(string Search_key)
        {
            SqlCommand cmd = new SqlCommand("Select * from contact_info where title=@Search", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Search", Search_key);
            return(fetchContactsInfo(cmd));
        }