Esempio n. 1
0
        public void grdListWorkFlow_EditCommand(object source, DataGridCommandEventArgs e)
        {
            UltilFunc _ulti = new UltilFunc();

            HPCBusinessLogic.DAL.TenQuyTrinh_DAL _dalqt = new HPCBusinessLogic.DAL.TenQuyTrinh_DAL();
            maanpham = Convert.ToInt32(this.grdListAnpham.DataKeys[e.Item.ItemIndex]);
            if (e.CommandArgument.ToString().ToLower() == "edit")
            {
                Page.Response.Redirect("~/Hethong/Edit_QuyTrinh.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&ID=" + maanpham);
            }
            if (e.CommandArgument.ToString().ToLower() == "copy")
            {
                _QTDAL.CopyQuyTrinhBienTap(maanpham);
                BindList_Doituong();
            }
            if (e.CommandArgument.ToString().ToLower() == "editdisplay")
            {
                string _sql  = string.Empty;
                bool   check = _dalqt.GetOneFromT_TenQuyTrinhByID(maanpham).Active;
                if (check)
                {
                    _sql = "update T_Ten_QuyTrinh set Active=0 where ID=" + maanpham;
                }
                else
                {
                    _sql = "update T_Ten_QuyTrinh set Active=1 where ID=" + maanpham;
                }
                _ulti.ExecSql(_sql);
                BindData();
            }
            if (e.CommandArgument.ToString().ToLower() == "role")
            {
                SetAddEdit(false, true);

                lblMaAnPham.Value = this.grdListAnpham.DataKeys[e.Item.ItemIndex].ToString();
                string Tenanpham = UltilFunc.GetTenAnpham_Display(maanpham);
                roleChucNang.Text = CommonLib.ReadXML("lblCauhinhquytrinh") + Tenanpham;
                BinQuytrinhtheoAnPham();
                BindList_Doituong();
            }
        }