Пример #1
0
    public static hizmet Select(int Id)
    {
        OleDbCommand komut = new OleDbCommand("usp_hizmetSelect");

        komut.CommandType = CommandType.StoredProcedure;

        OleDbParameter[] parametreler = new OleDbParameter[]
        {
            new OleDbParameter("@pId", Id)
        };

        komut.Parameters.AddRange(parametreler);

        return(ClassDAL.Selecthizmet(komut));
    }
Пример #2
0
        public HttpResponseMessage SelectDepartmentName()
        {
            HttpResponseMessage message;

            try
            {
                ClassDAL dal    = new ClassDAL();
                var      dynobj = new { result = dal.SelectDepartmentName() };
                message = Request.CreateResponse(HttpStatusCode.OK, dynobj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "something Wrong.Try Again!" });
            }
            return(message);
        }
 protected void Button1_Click(object sender, EventArgs e)
 {
     Label1.Visible = true;
     if (DropDownList2.SelectedIndex == 0 || DropDownList1.SelectedIndex == 0)
     {
         Label1.Text = "Select a Valid value";
     }
     else
     {
         objBEL        = new MasterBEL();
         objDAL        = new ClassDAL();
         objBEL.branch = TextBox1.Text;
         objBEL.course = DropDownList1.SelectedValue;
         Label1.Text   = objDAL.AddBranch(objBEL);
     }
     GridView1.DataBind();
 }
 protected void Button1_Click1(object sender, EventArgs e)
 {
     Label1.Visible = true;
     if (DropDownList2.SelectedIndex == 0)
     {
         Label1.Text = "Select a Valid value";
     }
     else
     {
         objBEL             = new MasterBEL();
         objDAL             = new ClassDAL();
         objBEL.designation = TextBox1.Text;
         Label1.Visible     = true;
         Label1.Text        = objDAL.AddDesignation(objBEL);
         GridView1.DataBind();
     }
 }
Пример #5
0
        public static void HandleDeleteClass(ListView lvwClass, string id_class)
        {
            foreach (ListViewItem item in lvwClassState.Items)
            {
                if (item.SubItems[0].Text == id_class)
                {
                    bool result = ClassDAL.DeleteClassWithId(id_class);
                    if (result)
                    {
                        lvwClassState.Items.Remove(item);
                        RenderListViewWithCourseAndFaculty(lvwClass);
                    }
                    return;
                }
            }

            MessageBox.Show(MessageBoxText.NotSelectListView, MessageBoxText.CaptionWarning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }
Пример #6
0
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            ClassDTO currentObject = (ClassDTO)dgvListClass.CurrentRow.DataBoundItem;
            ClassDAL classDAL      = new ClassDAL();

            classDAL.ConnectToDatabase();
            try
            {
                if (classDAL.DeleteClass(currentObject.ClassId))
                {
                    MessageBox.Show("Xoá lớp thành công!!!");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Xoá lớp thất bại!!!");
            }
        }
 protected void Button1_Click1(object sender, EventArgs e)
 {
     Label1.Visible = true;
     if (DropDownList2.SelectedIndex == 0 || DropDownList1.SelectedIndex == 0)
     {
         Label1.Text = "Select a Valid value";
     }
     else
     {
         objBEL          = new MasterBEL();
         objDAL          = new ClassDAL();
         objBEL.examType = TextBox1.Text;
         objBEL.course   = DropDownList1.SelectedValue;
         objBEL.dur      = int.Parse(TextBox2.Text);
         Label1.Text     = objDAL.AddExamType(objBEL);
         GridView1.DataBind();
     }
 }
Пример #8
0
    public Result <int> Delete()
    {
        OleDbCommand komut = new OleDbCommand("usp_epostaListDelete");

        komut.CommandType = CommandType.StoredProcedure;

        OleDbParameter[] parametreler = new OleDbParameter[]
        {
            new OleDbParameter("@pId", this.Id)
        };

        komut.Parameters.AddRange(parametreler);

//OleDbParameter sonuc = new OleDbParameter("@pReturnValue", DbType.Int32);
//sonuc.Direction = ParameterDirection.Output;
//komut.Parameters.Add(sonuc);

        return(ClassDAL.ExecuteWithResult(komut));
    }
Пример #9
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            //xoa lop hoc
            //if (this.dgvListClass.SelectedRows.Count > 0)
            //{
            //    ClassDAL classDAL = new ClassDAL();
            //    classDAL.ConnectToDatabase();
            //    ClassDTO currentObject = (ClassDTO)dgvListClass.CurrentRow.DataBoundItem;
            //    if(classDAL.DeleteClass(currentObject.ClassId))
            //    {
            //        classDAL = new ClassDAL();
            //        classDAL.ConnectToDatabase();
            //        dgvListClass.DataSource = classDAL.GetAllClass();
            //        dgvListClass.Update();
            //        dgvListClass.Refresh();
            //    }
            //}
            //DeleteClassForm f = new DeleteClassForm();
            //this.Hide();
            //f.ShowDialog();
            //this.Show();
            ClassDAL  classDAL  = new ClassDAL();
            SignupDAL signupDAL = new SignupDAL();

            classDAL.ConnectToDatabase();
            ClassDTO currentObject = (ClassDTO)dgvListClass.CurrentRow.DataBoundItem;

            nameClass = currentObject.ClassId.ToUpperInvariant();
            DialogResult dialogResult = MessageBox.Show("Bạn có chắc xoá lớp học: " + nameClass, "Thông báo", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                signupDAL.DeleteSignup(nameClass);
                classDAL.DeleteClass(nameClass);
                MessageBox.Show("Xoá lớp học thành công!!!");
                this.Close();
                ClassForm f = new ClassForm();
                f.Show();
            }

            ;
        }
 protected void Button1_Click(object sender, EventArgs e)
 {
     objBEL = new stuwork();
     objDAL = new ClassDAL();
     foreach (GridViewRow row in GridView1.Rows)
     {
         if (row.RowType == DataControlRowType.DataRow)
         {
             TextBox      txtrow  = (row.Cells[0].FindControl("TextBox1") as TextBox);
             DropDownList droprow = (row.Cells[0].FindControl("DropDownList1") as DropDownList);
             objBEL.fbCate = droprow.SelectedValue;
             Label name    = (row.Cells[0].FindControl("Label1") as Label);
             Label teacher = (row.Cells[0].FindControl("Label2") as Label);
             objBEL.name    = teacher.Text;
             objBEL.emailId = name.Text;
             objBEL.remark  = txtrow.Text;
             Label1.Text    = objDAL.AddFeedback(objBEL);
         }
     }
 }
Пример #11
0
        public static void HandleUpdateClass(ListView lvwClass, Class classModel)
        {
            bool courseResult = ClassDAL.UpdateClassWithId(classModel);

            if (courseResult)
            {
                foreach (ListViewItem item in lvwClassState.Items)
                {
                    if (item.SubItems[0].Text == classModel.IdClass)
                    {
                        ListViewItem itemUser = ClassModelToListViewItem(classModel);
                        for (int i = 0; i < item.SubItems.Count; i++)
                        {
                            item.SubItems[i].Text = i < itemUser.SubItems.Count ?
                                                    itemUser.SubItems[i].Text ?? null : string.Empty;
                        }
                    }
                }
                RenderListViewWithCourseAndFaculty(lvwClass);
            }
        }
Пример #12
0
    public Result <int> Update()
    {
        OleDbCommand komut = new OleDbCommand("usp_markaUpdate");

        komut.CommandType = CommandType.StoredProcedure;

        OleDbParameter[] parametreler = new OleDbParameter[]
        {
            new OleDbParameter("pId", Id)
            , new OleDbParameter("pResim", Resim)
            , new OleDbParameter("pAdi", Adi)
        };

        komut.Parameters.AddRange(parametreler);

//OleDbParameter sonuc = new OleDbParameter("@pReturnValue", DbType.Int32);
//sonuc.Direction = ParameterDirection.Output;
//komut.Parameters.Add(sonuc);

        return(ClassDAL.ExecuteWithResult(komut));
    }
Пример #13
0
    public Result <int> Update()
    {
        OleDbCommand komut = new OleDbCommand("usp_epostaListUpdate");

        komut.CommandType = CommandType.StoredProcedure;

        OleDbParameter[] parametreler = new OleDbParameter[]
        {
            new OleDbParameter("pId", Id)
            , new OleDbParameter("pEposta", Eposta)
            , new OleDbParameter("pTarih", Tarih.ToString())
            , new OleDbParameter("pTelefon", Telefon)
        };

        komut.Parameters.AddRange(parametreler);

//OleDbParameter sonuc = new OleDbParameter("@pReturnValue", DbType.Int32);
//sonuc.Direction = ParameterDirection.Output;
//komut.Parameters.Add(sonuc);

        return(ClassDAL.ExecuteWithResult(komut));
    }
Пример #14
0
    public Result <int> Insert()
    {
        OleDbCommand komut = new OleDbCommand("usp_markaInsert");

        komut.CommandType = CommandType.StoredProcedure;

        OleDbParameter[] parametreler = new OleDbParameter[]
        {
            //new OleDbParameter("pId", Id)
            new OleDbParameter("pResim", Resim)
            , new OleDbParameter("pAdi", Adi)
        };

        komut.Parameters.AddRange(parametreler);

//OleDbParameter sonuc = new OleDbParameter("@pReturnValue", DbType.Int32);
//sonuc.Direction = ParameterDirection.Output;
//komut.Parameters.Add(sonuc);

        OleDbCommand komutIdentity = new OleDbCommand("SELECT @@Identity FROM marka");

        return(ClassDAL.ExecuteReturnIdentity(komut, komutIdentity));
    }
Пример #15
0
    public Result <int> Insert()
    {
        OleDbCommand komut = new OleDbCommand("usp_sayacInsert");

        komut.CommandType = CommandType.StoredProcedure;

        OleDbParameter[] parametreler = new OleDbParameter[]
        {
            new OleDbParameter("pTarih", Tarih)
            //,new OleDbParameter("pGunluk", Gunluk)
            //,new OleDbParameter("pAylik", Aylik)
            , new OleDbParameter("pYillik", Yillik)
            , new OleDbParameter("pToplam", Toplam)
        };

        komut.Parameters.AddRange(parametreler);

//OleDbParameter sonuc = new OleDbParameter("@pReturnValue", DbType.Int32);
//sonuc.Direction = ParameterDirection.Output;
//komut.Parameters.Add(sonuc);

        return(ClassDAL.ExecuteWithResult(komut));
    }
Пример #16
0
        private void btConfim_Click(object sender, EventArgs e)
        {
            ClassDAL classDAL = new ClassDAL();

            classDAL.ConnectToDatabase();
            ClassDTO classDTO = new ClassDTO(textboxClassID.Text, textboxClassName.Text, textboxStartingHour.Text, startDate.Value, endDate.Value, ((ProgramDTO)comboBoxProgram.SelectedItem).ProgramId.ToString());

            try
            {
                if (classDAL.UpdateClass(classDTO))
                {
                    MessageBox.Show("Đổi lớp thành công!!!");
                    this.Close();
                    ClassForm f = new ClassForm();
                    f.Show();
                }
            }
            catch (Exception)

            {
                MessageBox.Show("Thay đổi thất bại!!!");
            }
        }
Пример #17
0
    public Result <int> Insert()
    {
        OleDbCommand komut = new OleDbCommand("usp_epostaListInsert");

        komut.CommandType = CommandType.StoredProcedure;

        OleDbParameter[] parametreler = new OleDbParameter[]
        {
            //new OleDbParameter("pId", Id)
            new OleDbParameter("pEposta", Eposta)
            , new OleDbParameter("pTarih", Tarih.ToString())
            , new OleDbParameter("pTelefon", Telefon)
        };

        komut.Parameters.AddRange(parametreler);

//OleDbParameter sonuc = new OleDbParameter("@pReturnValue", DbType.Int32);
//sonuc.Direction = ParameterDirection.Output;
//komut.Parameters.Add(sonuc);

        OleDbCommand komutIdentity = new OleDbCommand("SELECT @@Identity FROM epostaList");

        return(ClassDAL.ExecuteReturnIdentity(komut, komutIdentity));
    }
Пример #18
0
    public Result <int> Insert()
    {
        OleDbCommand komut = new OleDbCommand("usp_haberInsert");

        komut.CommandType = CommandType.StoredProcedure;

        OleDbParameter[] parametreler = new OleDbParameter[]
        {
            new OleDbParameter("pBaslik", Baslik)
            , new OleDbParameter("pResim", Resim)
            , new OleDbParameter("pYazi", Yazi)
            , new OleDbParameter("pTarih", Tarih)
            , new OleDbParameter("pAktif", Aktif)
            , new OleDbParameter("pAltBaslik", AltBaslik)
        };

        komut.Parameters.AddRange(parametreler);

        //OleDbParameter sonuc = new OleDbParameter("@pReturnValue", DbType.Int32);
        //sonuc.Direction = ParameterDirection.Output;
        //komut.Parameters.Add(sonuc);

        return(ClassDAL.ExecuteWithResult(komut));
    }
Пример #19
0
        // Delete Class
        public static string deleteClass(long CL)
        {
            int val = ClassDAL.isClassIDUsed(CL);

            if (val > 0)
            {
                return("This Class can't be deleted as it is used in other files!");
            }
            else
            {
                // Delete Query
                SqlParameter para       = new SqlParameter("@CL", CL);
                string       SQLRDelete = "delete from Classes where ClassID=@CL";
                int          rt         = SqlHelper.ExecuteNonQuery(SqlHelper.Connect, CommandType.Text, SQLRDelete, para);
                if (rt > 0)
                {
                    return("Class Deleted Successfully");
                }
                else
                {
                    return("Class not deleted or doesn't exist");
                }
            }
        }
Пример #20
0
        //public static ObservableCollection<Class> GetAllId(long idClass)
        //{
        //    return (ClassDAL.GetAllId(idClass));
        //}

        public bool CheckRegistration(long id)
        {
            bool res = ClassDAL.CheckRegistration(id);

            return(res);
        }
Пример #21
0
 public static ObservableCollection <Class> GetAll()
 {
     return(ClassDAL.GetAll());
 }
Пример #22
0
 public bool Update()
 {
     return(ClassDAL.Update(this));
 }
Пример #23
0
 /// <summary>
 /// 分页
 ///</summary>
 public static List <Class> PageSelectClass(int pageSize, int pageIndex, string WhereSrc, string PXzd, string PXType)
 {
     pageIndex = pageIndex - 1;
     return(ClassDAL.PageSelectClass(pageSize, pageIndex, WhereSrc, PXzd, PXType));
 }
Пример #24
0
 /// <summary>
 /// 修改
 ///</summary>
 public static int UpdateClass(Class ClassModel)
 {
     return(ClassDAL.UpdateClass(ClassModel));
 }
Пример #25
0
        public bool addClass(Dictionary <string, string> kv)
        {
            ClassDAL ClassDAL = new ClassDAL();

            return(ClassDAL.addClass(kv));
        }
Пример #26
0
 public ClassBLL()
 {
     classDAL = new ClassDAL();
 }
Пример #27
0
 /// <summary>
 /// 查询全部
 ///</summary>
 public static List <Class> AllData(string WhereSrc, string PXzd, string PXType)
 {
     return(ClassDAL.AllData(WhereSrc, PXzd, PXType));
 }
Пример #28
0
 /// <summary>
 /// 查询条数
 ///</summary>
 public static int CountNumber(string NewWHere)
 {
     return(ClassDAL.CountNumber(NewWHere));
 }
Пример #29
0
 /// <summary>
 /// 根据主键查询实体
 ///</summary>
 public static Class GetIdByClass(int Id)
 {
     return(ClassDAL.GetIdByClass(Id));
 }
Пример #30
0
 /// <summary>
 /// 根据主键删除
 ///</summary>
 public static int DeleteClass(int Id)
 {
     return(ClassDAL.DeleteClass(Id));
 }