Beispiel #1
0
    protected void btnXoa_Click(object sender, EventArgs e)
    {
        cls_City      cls;
        List <object> selectedKey = grvList.GetSelectedFieldValues(new string[] { "city_id" });

        if (selectedKey.Count > 0)
        {
            foreach (var item in selectedKey)
            {
                cls = new cls_City();
                tbCity checkImage = (from i in db.tbCities where i.city_id == Convert.ToInt32(item) select i).SingleOrDefault();
                if (cls.City_Xoa(Convert.ToInt32(item)))
                {
                    alert.alert_Success(Page, "Xóa thành công", "");
                }
                else
                {
                    alert.alert_Error(Page, "Xóa thất bại", "");
                }
            }
        }
        else
        {
            alert.alert_Warning(Page, "Bạn chưa chọn dữ liệu", "");
        }
    }
Beispiel #2
0
 public Student()
 {
     _StudentDTO        = new cls_StudentDTO();
     commonBindControl  = new CommonBindControl();
     _sectionDTO        = new cls_SectionDTO();
     _cls_City          = new cls_City();
     _classDTO          = new cls_ClassDTO();
     _StudentSubjectDTO = new cls_StudentSubjectDTO();
 }
Beispiel #3
0
    protected void btnLuu_Click(object sender, EventArgs e)
    {
        cls_City cls = new cls_City();

        if (checknull() == false)
        {
            alert.alert_Warning(Page, "Hãy nhập đầy đủ thông tin!", "");
        }
        else
        {
            if (Session["_id"].ToString() == "0")
            {
                try
                {
                    if (cls.City_Them(txtName.Text, txtToaDo.Text, Convert.ToInt32(txtZoom.Text)))
                    {
                        alert.alert_Success(Page, "Thêm thành công", "");
                        popupControl.ShowOnPageLoad = false;
                        loadData();
                    }
                    else
                    {
                        alert.alert_Error(Page, "Thêm thất bại", "");
                    }
                }
                catch
                {
                    alert.alert_Error(Page, "Zoom phải là số!", "");
                }
            }
            else
            {
                try
                {
                    if (cls.City_Sua(Convert.ToInt32(Session["_id"].ToString()), txtName.Text, txtToaDo.Text, Convert.ToInt32(txtZoom.Text)))
                    {
                        //alert.alert_Success(Page, "Cập nhật thành công", "");
                        ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "Alert", "swal('Cập nhật thành công','','success').then(function(){grvList.Refresh();})", true);
                        popupControl.ShowOnPageLoad = false;
                        loadData();
                    }
                    else
                    {
                        alert.alert_Error(Page, "Cập nhật thất bại", "");
                    }
                }
                catch
                {
                    alert.alert_Error(Page, "Zoom phải là số!", "");
                }
            }
        }
    }