Esempio n. 1
0
        public bool ht_phanquyen_checkTontaiQuyenTruyCap(truycaptailieu tc)
        {
            string[]  namepara  = { "@MANHOM", "@PHONGID", "@MAMUCLUC" };
            object[]  valuepara = { tc.Manhom, tc.Phongid, tc.Mamucluc };
            DataTable dt        = dataAsset.data.outputdataTable("ht_phanquyen_checkTontaiQuyenTruyCap", namepara, valuepara);

            if (dt.Rows.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
        public JsonResult ht_phanquyen_GhiNhan(truycaptailieu tc, int[] xem, int[] sua, int[] them, string[] mamucluc)
        {
            int result = -1;

            if (xem.Length == sua.Length && sua.Length == mamucluc.Length)
            {
                string[] namepara = { "@MANHOM", "@PHONGID", "@MAMUCLUC", "@XEM", "@SUA", "@THEM" };
                for (int i = 0; i < xem.Length; i++)
                {
                    object[] valuepara = { tc.Manhom, tc.Phongid, mamucluc[i], xem[i], sua[i], them[i] };
                    if (ht_phanquyen_checkTontaiQuyenTruyCap(tc))
                    {
                        if (dataAsset.data.inputdata("ht_phanquyen_GhiNhanTruyCapTLUpDate", namepara, valuepara))
                        {
                            result = 1;
                        }
                        else
                        {
                            result = -1;
                        }
                    }
                    else
                    {
                        if (dataAsset.data.inputdata("ht_phanquyen_GhiNhanTruyCapTL", namepara, valuepara))
                        {
                            result = 1;
                        }
                        else
                        {
                            result = -1;
                        }
                    }
                }
            }
            else
            {
                result = -1;
            }

            return(Json(result, JsonRequestBehavior.AllowGet));
        }