// --------------- Click chuyen trang thai-----------------//
        private void Gw_dsdv_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                ContextMenuStrip menu = new ContextMenuStrip();

                int position_row = gw_dsdv.HitTest(e.X, e.Y).RowIndex;

                if (position_row >= 0)
                {
                    DSDichVu dichVu = new DSDichVu();
                    dichVu = tempList[selectRow];
                    if (dichVu.TrangThai == "Unfulfilled")
                    {
                        menu.Items.Add("Chuyển sang đang xử lý").Name = "CdangXuLy";
                    }
                    else if (dichVu.TrangThai == "Processing")
                    {
                        menu.Items.Add("Xử lý thất bại").Name   = "CThatbai";
                        menu.Items.Add("Xử lý thành công").Name = "CXuLyXong";
                    }
                    else if (dichVu.TrangThai == "Completed")
                    {
                        menu.Items.Add("Hoàn thành").Name = "CHoanThanh";
                    }
                }
                menu.Show(gw_dsdv, new Point(e.X, e.Y));
                menu.ItemClicked += Menu_ItemClicked;
            }
        }
        private void Menu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            DSDichVu dichVu = new DSDichVu();
            bool     kq;

            switch (e.ClickedItem.Name.ToString())
            {
            case "CdangXuLy":
                dichVu             = tempList[selectRow];
                dichVu.MaTrangThai = "TT0002";
                kq = dsDichVu_Bus.suaTT(dichVu);
                break;

            case "CThatbai":
                dichVu             = tempList[selectRow];
                dichVu.MaTrangThai = "TT0005";
                kq = dsDichVu_Bus.suaTT(dichVu);
                break;

            case "CXuLyXong":
                dichVu             = tempList[selectRow];
                dichVu.MaTrangThai = "TT0003";
                kq = dsDichVu_Bus.suaTT(dichVu);
                break;

            case "CHoanThanh":
                dichVu             = tempList[selectRow];
                dichVu.MaTrangThai = "TT0004";
                kq = dsDichVu_Bus.suaTT(dichVu);
                break;
            }
            if (lb_trangThai.Text == "Tất cả")
            {
                timDichVu();
            }
            else if (lb_trangThai.Text == "Chưa xử lý")
            {
                timDichVu("TT0001");
            }
            else if (lb_trangThai.Text == "Đang xử lý")
            {
                timDichVu("TT0002");
            }
            else if (lb_trangThai.Text == "Xử lý xong")
            {
                timDichVu("TT0003");
            }
            else if (lb_trangThai.Text == "Hoàn thành")
            {
                timDichVu("TT0004");
            }
            else
            {
                timDichVu("TT0005");
            }
        }
Example #3
0
 protected void updateservices_Command(object sender, CommandEventArgs e)
 {
     if (e.CommandName == "updateservices")
     {
         int      update   = Convert.ToInt16(e.CommandArgument);
         DSDichVu madichvu = svc.layra1dv(update);
         Session["madichvu"] = madichvu;
         Response.Redirect("DichVuEdit.aspx");
     }
 }
 protected void btnupdateService_Click(object sender, EventArgs e)
 {
     try
     {
         DSDichVu dSDichVu = (DSDichVu)Session["madichvu"];
         dSDichVu.TenDichVu = txtTenDichVu.Text;
         dSDichVu.Gia       = double.Parse(txtGia.Text);
         dSDichVu.danhmuc   = int.Parse(DDL_Danhmuc.SelectedValue.ToString());
         dSDichVu.MoTa      = txtMoTa.Text;
         svc.capNhatDV(dSDichVu);
         lbmsgupdateservice.Text = "Cập nhật thành công";
     }
     catch
     {
         lbmsgupdateservice.Text = "Có lỗi, không cập nhật được";
     }
 }
Example #5
0
 protected void btnaddService_Click(object sender, EventArgs e)
 {
     try
     {
         DSDichVu dSDichVu = new DSDichVu();
         dSDichVu.TenDichVu = txtTenDichVu.Text;
         dSDichVu.Gia       = double.Parse(txtGia.Text);
         dSDichVu.danhmuc   = int.Parse(DDL_Danhmuc.SelectedValue.ToString());
         dSDichVu.MoTa      = txtMoTa.Text;
         svc.themDichVu(dSDichVu);
         lbmsgaddservice.Text = "Thêm thành công";
     }
     catch
     {
         lbmsgaddservice.Text = "Có lỗi, không thêm được";
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["TaiKhoan"] != null)
         {
         }
         else
         {
             Response.Redirect("../../index.aspx");
         }
         DSDichVu dSDichVu = (DSDichVu)Session["madichvu"];
         txtTenDichVu.Text          = dSDichVu.TenDichVu;
         txtGia.Text                = dSDichVu.Gia.ToString();
         txtMoTa.Text               = dSDichVu.MoTa;
         DDL_Danhmuc.DataSource     = getDanhMuc.GetDanhMuc();
         DDL_Danhmuc.DataTextField  = "tendanhmuc";
         DDL_Danhmuc.DataValueField = "madanhmuc";
         DataBind();
         DDL_Danhmuc.SelectedValue = dSDichVu.danhmuc.ToString();
     }
 }
Example #7
0
        public bool suaTT(DSDichVu dv)
        {
            bool re = dsDichVu_DAL.suaTT(dv);

            return(re);
        }