Exemplo n.º 1
0
 public frmBuhaophi(AccessData acc, int nhom, string ngay, int loai, int userid, string users, string makp, string mmyy, string kho, bool giaban, bool thuhoi, int _khudt)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     d         = acc; i_nhom = nhom; i_loai = loai; i_userid = userid; s_userid = users;
     s_ngay    = ngay; s_makp = makp; s_mmyy = mmyy; s_kho = kho; bGiaban = giaban; butThuhoi.Enabled = thuhoi;
     this.Text = "Duyệt dù trù hao phí thuốc, vật tư y tế theo khoa/phòng (" + users.Trim() + ")";
     i_khudt   = _khudt;
     lan.Read_Language_to_Xml(this.Name.ToString(), this);
     lan.Changelanguage_to_English(this.Name.ToString(), this);
     //
     // TODO: Add any constructor code after InitializeComponent call
     //
 }
Exemplo n.º 2
0
        public frmPhieulinh_ng(AccessData acc, int nhom, string kho, string kp, string loaint, string suserid, string mmyy, int _userid)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            d        = acc; i_nhom = nhom; s_loaint = loaint;
            s_makho  = kho; s_makp = kp; s_userid = suserid; s_mmyy = mmyy;
            i_userid = _userid;

            lan.Read_Language_to_Xml(this.Name.ToString(), this);
            lan.Changelanguage_to_English(this.Name.ToString(), this);
            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
Exemplo n.º 3
0
 public frmNhap(AccessData acc, string loai, string mmyy, string ngay, int nhom, int userid, string kho, string title, bool ban, bool admin, string _manhom, int _khudt)
 {
     InitializeComponent();
     init();
     base.iNhom   = nhom;
     base.sManhom = _manhom;
     base.sKho    = kho;
     base.iUserid = userid;
     base.sMmyy   = mmyy;
     base.sNgay   = ngay;
     base.sLoai   = loai;
     base.bBan    = ban;
     base.b_Admin = admin;
     base.sTitle  = title;
     base.iKhudt  = _khudt;
 }
Exemplo n.º 4
0
 public frmDMICD10(AccessData acc, string table, string vICD, string vTen, bool chon)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     lan.Read_Language_to_Xml(this.Name.ToString(), this);
     lan.Changelanguage_to_English(this.Name.ToString(), this);
     s_table = table; m = acc; b_chon = chon; mICD = vICD; mTen = vTen; if (m.bBogo)
     {
         tv.GanBogo(this, textBox111);
     }
     //
     // TODO: Add any constructor code after InitializeComponent call
     //
 }
Exemplo n.º 5
0
 public frmThthbn(AccessData acc, string makp, int loaiba)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     lan.Read_Language_to_Xml(this.Name.ToString(), this);
     lan.Changelanguage_to_English(this.Name.ToString(), this);
     m = acc; s_makp = makp; i_loaiba = loaiba; if (m.bBogo)
     {
         tv.GanBogo(this, textBox111);
     }
     //
     // TODO: Add any constructor code after InitializeComponent call
     //
 }
Exemplo n.º 6
0
        public frmPhieuxuat_kh(AccessData acc, int nhom, string kho, string loaikhac, int _userid)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            d        = acc; i_nhom = nhom; s_loaikhac = loaikhac;
            s_makho  = kho;
            i_userid = _userid;

            lan.Read_Language_to_Xml(this.Name.ToString(), this);
            lan.Changelanguage_to_English(this.Name.ToString(), this);
            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
Exemplo n.º 7
0
 public frmXemtutructh(AccessData acc, int kho, int makp, string mmyy, string tenkho, int nhom)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     ttb       = acc;
     i_kho     = kho;
     i_makp    = makp;
     s_mmyy    = mmyy;
     i_nhom    = nhom;
     this.Text = "Tồn " + tenkho.Trim() + " tổng hợp tháng " + mmyy.Substring(0, 2) + " năm " + mmyy.Substring(2, 2);
     //
     // TODO: Add any constructor code after InitializeComponent call
     //
 }
Exemplo n.º 8
0
 public frmXemtonct(AccessData acc, int kho, string mmyy, string tenkho, bool b_giaban, int nhom)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     ttb       = acc;
     i_kho     = kho;
     s_mmyy    = mmyy;
     bGiaban   = b_giaban;
     i_nhom    = nhom;
     this.Text = "Tồn " + tenkho.Trim() + " chi tiết tháng " + mmyy.Substring(0, 2) + " năm " + mmyy.Substring(2, 2);
     //
     // TODO: Add any constructor code after InitializeComponent call
     //
 }
Exemplo n.º 9
0
        public rptBieukhoa(AccessData acc, string title, string table, string makp)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            lan.Read_Language_to_Xml(this.Name.ToString(), this);
            lan.Changelanguage_to_English(this.Name.ToString(), this);
            m         = acc;
            this.Text = title;
            s_table   = table; s_makp = makp;
            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
Exemplo n.º 10
0
        public frmXemtonthck2(AccessData acc, string mmyy, int nhom, string makho)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            d         = acc;
            s_mmyy    = mmyy; i_nhom = nhom; s_kho = makho;
            this.Text = "Tồn tổng hợp các kho tháng " + mmyy.Substring(0, 2) + " năm " + mmyy.Substring(2, 2);

            lan.Read_Language_to_Xml(this.Name.ToString(), this);
            lan.Changelanguage_to_English(this.Name.ToString(), this);
            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
Exemplo n.º 11
0
        public DataTable d_getDMDoiTuong()
        {
            AccessData data = new AccessData();
            DataSet    ds   = new DataSet();
            DataTable  dt   = new DataTable();

            string sql = "select  madoituong ma,doituong ten from Doituong order by madoituong ";

            try
            {
                ds = data.get_data(sql);
                dt = ds.Tables[0];
            }
            catch { }
            return(dt);
        }
Exemplo n.º 12
0
        public DataTable d_getDMNhomBHYT()
        {
            AccessData data = new AccessData();
            DataSet    ds   = new DataSet();
            DataTable  dt   = new DataTable();

            string sql = "select  id,ten from BV115.v_nhombhyt where stt>0 order by stt ";

            try
            {
                ds = data.get_data(sql);
                dt = ds.Tables[0];
            }
            catch { }
            return(dt);
        }
Exemplo n.º 13
0
        public DataTable get_NHOMXHH()
        {
            AccessData data = new AccessData();
            DataSet    ds   = new DataSet();
            DataTable  dt   = new DataTable();

            string sql = "select to_number(id) ID,LOAIBC ||'_'||XHH||'_'||VIETTAT NAME from bv115.NHOMXHH order by LOAIBC || '-' ||NHOMBC ";

            try
            {
                ds = data.get_data(sql);
                dt = ds.Tables[0];
            }
            catch { }
            return(dt);
        }
Exemplo n.º 14
0
        public frmxkngay(AccessData acc, int nhom, string kho)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            d       = acc;
            i_nhom  = nhom;
            s_makho = kho;

            lan.Read_Language_to_Xml(this.Name.ToString(), this);
            lan.Changelanguage_to_English(this.Name.ToString(), this);
            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
Exemplo n.º 15
0
        public DataTable d_getDM_NHOMBC()
        {
            AccessData data = new AccessData();
            DataSet    ds   = new DataSet();
            DataTable  dt   = new DataTable();

            string sql = "select id ma,TENNHOM ten ,SUDUNG from bv115.DMNHOMBC order by TENNHOM";

            try
            {
                ds = data.get_data(sql);
                dt = ds.Tables[0];
            }
            catch { }
            return(dt);
        }
Exemplo n.º 16
0
        public DataTable d_getDMKhoaPhong()
        {
            AccessData data = new AccessData();
            DataSet    ds   = new DataSet();
            DataTable  dt   = new DataTable();

            string sql = "select makp id,tenkp ten from btdkp_bv order by tenkp ";

            try
            {
                ds = data.get_data(sql);
                dt = ds.Tables[0];
            }
            catch { }
            return(dt);
        }
Exemplo n.º 17
0
        public DataTable d_getDM_BCDieuKien(string sudung)
        {
            AccessData data = new AccessData();
            DataSet    ds   = new DataSet();
            DataTable  dt   = new DataTable();

            string sql = "select id ma,tenbaocao ten from bv115.bc_dieukien WHERE SUDUNG LIKE '%" + sudung + "%' order by tenbaocao ";

            try
            {
                ds = data.get_data(sql);
                dt = ds.Tables[0];
            }
            catch { }
            return(dt);
        }
Exemplo n.º 18
0
 public void Printer(AccessData m, DataSet ds, string tenfile, string msg, int kieu, int copy)
 {
     try
     {
         ReportDocument oRpt = new ReportDocument();
         oRpt.Load("..\\..\\..\\report\\" + tenfile, OpenReportMethod.OpenReportByTempCopy);
         oRpt.SetDataSource(ds);
         oRpt.DataDefinition.FormulaFields["SoYTe"].Text     = "'" + m.Syte + "'";
         oRpt.DataDefinition.FormulaFields["BenhVien"].Text  = "'" + m.Tenbv + "'";
         oRpt.DataDefinition.FormulaFields["TenBenhAn"].Text = "'" + msg + "'";
         oRpt.PrintOptions.PaperSize        = PaperSize.DefaultPaperSize;
         oRpt.PrintOptions.PaperOrientation = (kieu == 1)?PaperOrientation.Portrait:PaperOrientation.Landscape;
         oRpt.PrintToPrinter(copy, false, 0, 0);
     }
     catch (Exception ex) { MessageBox.Show(ex.Message); }
 }
Exemplo n.º 19
0
 public frmSlkhambenh(AccessData acc)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     lan.Read_Language_to_Xml(this.Name.ToString(), this);
     lan.Changelanguage_to_English(this.Name.ToString(), this);
     m = acc; if (m.bBogo)
     {
         tv.GanBogo(this, textBox111);
     }
     //
     // TODO: Add any constructor code after InitializeComponent call
     //
 }
Exemplo n.º 20
0
 public frmInkqthau(AccessData acc, int nhom, string mmyy, int _userid)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     d        = acc;
     i_nhom   = nhom;
     s_mmyy   = mmyy;
     d_userid = _userid;
     lan.Read_Language_to_Xml(this.Name.ToString(), this);
     lan.Changelanguage_to_English(this.Name.ToString(), this);
     //
     // TODO: Add any constructor code after InitializeComponent call
     //
 }
Exemplo n.º 21
0
 public frmCls_noidung(AccessData acc, string loai, bool admin)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     lan.Read_Language_to_Xml(this.Name.ToString(), this);
     lan.Changelanguage_to_English(this.Name.ToString(), this);
     m = acc; s_loai = loai; bAdmin = admin; if (m.bBogo)
     {
         tv.GanBogo(this, textBox111);
     }
     //
     // TODO: Add any constructor code after InitializeComponent call
     //
 }
Exemplo n.º 22
0
 public frmMultikho(AccessData acc, int nhom, string kho, string mmyy, int userid)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     ttb        = acc;
     i_nhom     = nhom;
     i_userid   = userid;
     s_makho    = kho;
     mm.Value   = decimal.Parse(mmyy.Substring(0, 2));
     yyyy.Value = decimal.Parse("20" + mmyy.Substring(2, 2));
     //
     // TODO: Add any constructor code after InitializeComponent call
     //
 }
Exemplo n.º 23
0
 public frmDutrucstt(AccessData acc, string _ngay, int _makho, string _tenkho, int manguon, int nhom, string mmyy, int _userid, int _makp, int _matutruc, string _tenkhoa)
 {
     InitializeComponent();
     this.s_ngay = _ngay;
     this.d      = acc;
     i_makho     = _makho;
     s_tenkho    = _tenkho;
     i_manguon   = manguon;
     i_nhom      = nhom;
     s_mmyy      = mmyy;
     //d_ngay = _ngay;
     i_userid   = _userid;
     i_makp     = _makp;
     i_matutruc = _matutruc;
     s_tenkhoa  = _tenkhoa;
 }
Exemplo n.º 24
0
 public frmIcd10(AccessData acc, string table, int userid)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     lan.Read_Language_to_Xml(this.Name.ToString(), this);
     lan.Changelanguage_to_English(this.Name.ToString(), this);
     m = acc; s_table = table; i_userid = userid; if (m.bBogo)
     {
         tv.GanBogo(this, textBox111);
     }
     //
     // TODO: Add any constructor code after InitializeComponent call
     //
 }
Exemplo n.º 25
0
        public frmMmyy(AccessData acc, string mmyy)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            d          = acc;
            mm.Value   = decimal.Parse(mmyy.Substring(0, 2));
            yyyy.Value = decimal.Parse("20" + mmyy.Substring(2, 2));

            lan.Read_Language_to_Xml(this.Name.ToString(), this);
            lan.Changelanguage_to_English(this.Name.ToString(), this);
            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
Exemplo n.º 26
0
        /// <summary>
        /// Метод возвращает необходимые состояния кнопок для карточки КМ
        /// </summary>
        /// <param name="Item">Текущий Item</param>
        /// <param name="State">Текущий статус карточки</param>
        /// <returns></returns>
        private static AccessData GetCMAccessData(SPWeb Web, SPGroup Group, SPListItem Item, CardState State, List<string> Companies)
        {
            AccessData result = new AccessData();

            bool IsExpert = Group.Name == GlobalConstants.Groups.Expert;

            bool InCompany = Companies.Any(Company => Item[GlobalConstants.ControlMeasure_Fields.CompanyName].ToString().Contains(Company));

            bool Approver = new SPFieldUserValue(Web, Item[GlobalConstants.ControlMeasure_Fields.Approver].ToString()).User.ID == Web.CurrentUser.ID;

            bool Responsible = new SPFieldUserValue(Web, Item[GlobalConstants.ControlMeasure_Fields.Responsible].ToString()).User.ID == Web.CurrentUser.ID;

            bool InMailingList = new SPFieldUserValueCollection(Web, Item[GlobalConstants.ControlMeasure_Fields.MailingList].ToString()).Any(User => User.User.ID == Web.CurrentUser.ID);

            bool AuditorOrAdministrator = Group.Name == GlobalConstants.Groups.Administrator || Group.Name == GlobalConstants.Groups.Auditor;

            result.Edit.Enabled = ((InCompany || Approver || Responsible || InMailingList) && IsExpert) || (InMailingList && AuditorOrAdministrator);
            result.Edit.Visible = State;

            result.Bind.Enabled = ((InCompany || Approver || Responsible || InMailingList) && IsExpert) || (InMailingList && AuditorOrAdministrator);
            result.Bind.Visible = State;

            result.CreateNewRequestCM.Enabled = ((InCompany || Approver || Responsible || InMailingList) && IsExpert) && (!AuditorOrAdministrator);
            result.CreateNewRequestCM.Visible = State;

            result.ExcelExport.Enabled = ((InCompany || Approver || Responsible || InMailingList) && IsExpert)&& (!AuditorOrAdministrator);
            result.ExcelExport.Visible = State;

            result.ToAffirmation.Enabled = ((InCompany || Responsible || InMailingList) && IsExpert) && (!AuditorOrAdministrator);
            result.ToAffirmation.Visible = State;

            result.ToWork.Enabled = (Approver && IsExpert) && (!AuditorOrAdministrator);
            result.ToWork.Visible = State;

            result.ToRework.Enabled = (Approver && IsExpert) && (!AuditorOrAdministrator);
            result.ToRework.Visible = State;

            result.Close.Enabled = ((InCompany || Approver || Responsible || InMailingList) && IsExpert) || (InMailingList && AuditorOrAdministrator);
            result.Close.Visible = State;

            //
            //Нужно доделать доступность кнопок в зависимости от дополнительных параметров, как-то : указана ли компания, какой текущий статус карточки и тд тп
            //
            //                                  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

            return result;
        }
Exemplo n.º 27
0
 public frmKh133(string hoten, int userid, int mabv)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     lan.Read_Language_to_Xml(this.Name.ToString(), this);
     lan.Changelanguage_to_English(this.Name.ToString(), this);
     m          = new AccessData();
     s_userid   = hoten;
     i_userid   = userid;
     i_mabv     = mabv;
     this.Text += "//" + s_userid;
     //
     // TODO: Add any constructor code after InitializeComponent call
     //
 }
Exemplo n.º 28
0
        public DataTable d_getDMKHU(string filter)
        {
            AccessData data = new AccessData();
            DataSet    ds   = new DataSet();
            DataTable  dt   = new DataTable();

            string sql = "select  id id,name name from bv115.dmcdhakhu order by name  ";

            sql = sql.Replace("{filter}", filter);
            try
            {
                ds = data.get_data(sql);
                dt = ds.Tables[0];
            }
            catch { }
            return(dt);
        }
Exemplo n.º 29
0
 public frmLeDanhmuc(AccessData acc, int capid, string tables, string title)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     lan.Read_Language_to_Xml(this.Name.ToString(), this);
     lan.Changelanguage_to_English(this.Name.ToString(), this);
     m         = acc; s_tables = tables; i_capid = capid;
     this.Text = title; if (m.bBogo)
     {
         tv.GanBogo(this, textBox111);
     }
     //
     // TODO: Add any constructor code after InitializeComponent call
     //
 }
Exemplo n.º 30
0
        private void btnInBC_Click(object sender, EventArgs e)
        {
            string s_tungay  = for_ngay_yyyymmdd(haison1.tungay);
            string s_denngay = for_ngay_yyyymmdd(haison1.denngay);


            CMay datamay = new CMay();

            ds = datamay.get_BCBaoTri(s_tungay, s_denngay);
            string rptName = "BC_BAOTRI.rpt";

            rptName = cbLoaiBaoCao.Text;
            AccessData acc = new AccessData();
            frmReport  a   = new frmReport(acc, ds.Tables[0], rptName, "TỪ NGÀY " + haison1.tungay + " ĐẾN NGÀY " + haison1.denngay, "", "", "", "", "", "", "", "", "");

            a.Show();
        }
Exemplo n.º 31
0
        public DataTable d_getDMNhomCDHA(string filter)
        {
            AccessData data = new AccessData();
            DataSet    ds   = new DataSet();
            DataTable  dt   = new DataTable();

            string sql = "select  nhom_cdha id,nhom_cdha ten from bv115.cdha_nhom where instr ('{filter}',nhom_cdha)>0 group by nhom_cdha ";

            sql = sql.Replace("{filter}", filter);
            try
            {
                ds = data.get_data(sql);
                dt = ds.Tables[0];
            }
            catch { }
            return(dt);
        }
Exemplo n.º 32
0
        /// <summary>
        /// Метод возвращает необходимые состояния кнопок для карточки Исходящего документа
        /// </summary>
        /// <param name="Item">Текущий Item</param>
        /// <param name="State">Текущий статус карточки</param>
        /// <returns></returns>
        private static AccessData GetOutboxAccessData(SPWeb Web, SPGroup Group, SPListItem Item, CardState State, List<string> Companies)
        {
            AccessData result = new AccessData();

            bool IsExpert = Group.Name == GlobalConstants.Groups.Expert;

            bool InCompany = Companies.Any(Company => Item[GlobalConstants.OutboxCorrespondence_Fields.Company].ToString().Contains(Company));

            bool InMailingList = new SPFieldUserValueCollection(Web, Item[GlobalConstants.OutboxCorrespondence_Fields.DeliveryList].ToString()).Any(User => User.User.ID == Web.CurrentUser.ID);

            bool AuditorOrAdministrator = Group.Name == GlobalConstants.Groups.Administrator || Group.Name == GlobalConstants.Groups.Auditor;

            result.Bind.Enabled = ((InCompany || InMailingList) && IsExpert) || (InMailingList && AuditorOrAdministrator);
            result.Bind.Visible = State;

            result.Edit.Enabled = ((InCompany || InMailingList) && IsExpert) || (InMailingList && AuditorOrAdministrator);
            result.Edit.Visible = State;

            result.Notifications.Enabled = ((InCompany || InMailingList) && IsExpert) || (InMailingList && AuditorOrAdministrator);
            result.Notifications.Visible = State;

            //
            //Нужно доделать доступность кнопок в зависимости от дополнительных параметров, как-то : указана ли компания, какой текущий статус карточки и тд тп
            //
            //                                  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

            return result;
        }
Exemplo n.º 33
0
        /// <summary>
        /// Класс, реализующий сложение прав всех групп пользователя
        /// </summary>
        private static AccessData GetUserAccessData(SPWeb Web, SPListItem Item, CardState State)
        {
            AccessData result = new AccessData();

            foreach (SPGroup Group in Web.CurrentUser.Groups)
            {
                result += GetGroupAccessData(Web, Group, Item, State, GlobalMethods.GetUserCompanies(Web.CurrentUser.Name));
            }

            return result;
        }
Exemplo n.º 34
0
 /// <summary>
 /// Внутренний метод, который устанавливает кнопкам свойства
 /// </summary>
 /// <param name="FinalAccessData"></param>
 /// <param name="ControlButtons"></param>
 private static void SetButtonsState(AccessData FinalAccessData, params Button[] ControlButtons)
 {
     //Тут тело метода
 }
Exemplo n.º 35
0
            /// <summary>
            /// Метод, реализующий оператор сложения для двух экземпляров класса AccessData
            /// </summary>
            /// <param name="GroupAccess1">Доступы первой группы</param>
            /// <param name="GroupAccess2">Доступы второй группы</param>
            /// <returns></returns>
            public static AccessData operator +(AccessData GroupAccess1, AccessData GroupAccess2)
            {
                AccessData result = new AccessData();

                result.ToWork.Enabled = GroupAccess1.ToWork.Enabled || GroupAccess2.ToWork.Enabled;
                result.ToWork.Visible = GroupAccess1.ToWork.Visible || GroupAccess2.ToWork.Visible;

                result.ToRework.Enabled = GroupAccess1.ToRework.Enabled || GroupAccess2.ToRework.Enabled;
                result.ToRework.Visible = GroupAccess1.ToRework.Visible || GroupAccess2.ToRework.Visible;

                result.ToAffirmation.Enabled = GroupAccess1.ToAffirmation.Enabled || GroupAccess2.ToAffirmation.Enabled;
                result.ToAffirmation.Visible = GroupAccess1.ToAffirmation.Visible || GroupAccess2.ToAffirmation.Visible;

                result.Bind.Enabled = GroupAccess1.Bind.Enabled || GroupAccess2.Bind.Enabled;
                result.Bind.Visible = GroupAccess1.Bind.Visible || GroupAccess2.Bind.Visible;

                result.CreateNewRequestCM.Enabled = GroupAccess1.CreateNewRequestCM.Enabled || GroupAccess2.CreateNewRequestCM.Enabled;
                result.CreateNewRequestCM.Visible = GroupAccess1.CreateNewRequestCM.Visible || GroupAccess2.CreateNewRequestCM.Visible;

                result.CreateOutboxDocument.Enabled = GroupAccess1.CreateOutboxDocument.Enabled || GroupAccess2.CreateOutboxDocument.Enabled;
                result.CreateOutboxDocument.Visible = GroupAccess1.CreateOutboxDocument.Visible || GroupAccess2.CreateOutboxDocument.Visible;

                result.CreateNewRequestInbox.Enabled = GroupAccess1.CreateNewRequestInbox.Enabled || GroupAccess2.CreateNewRequestInbox.Enabled;
                result.CreateNewRequestInbox.Visible = GroupAccess1.CreateNewRequestInbox.Visible || GroupAccess2.CreateNewRequestInbox.Visible;

                result.UpdateRequestInbox.Enabled = GroupAccess1.UpdateRequestInbox.Enabled || GroupAccess2.UpdateRequestInbox.Enabled;
                result.UpdateRequestInbox.Visible = GroupAccess1.UpdateRequestInbox.Visible || GroupAccess2.UpdateRequestInbox.Visible;

                result.CreateNewCMInbox.Enabled = GroupAccess1.CreateNewCMInbox.Enabled || GroupAccess2.CreateNewCMInbox.Enabled;
                result.CreateNewCMInbox.Visible = GroupAccess1.CreateNewCMInbox.Visible || GroupAccess2.CreateNewCMInbox.Visible;

                result.UpdateCMInbox.Enabled = GroupAccess1.UpdateCMInbox.Enabled || GroupAccess2.UpdateCMInbox.Enabled;
                result.UpdateCMInbox.Visible = GroupAccess1.UpdateCMInbox.Visible || GroupAccess2.UpdateCMInbox.Visible;

                result.CanDeleteReference = GroupAccess1.CanDeleteReference || GroupAccess2.CanDeleteReference;

                return result;
            }
Exemplo n.º 36
0
 /// <summary>
 /// Метод, возвращающий права для группы по умолчанию, в зависимости от карточки и её статуса
 /// </summary>
 /// <param name="Group">Группа</param>
 /// <returns></returns>
 private static AccessData GetGroupAccessData(SPWeb Web, SPGroup Group, SPListItem Item, CardState State, List<string> Companies)
 {
     AccessData result = new AccessData();
     switch (Item.ParentList.Title)
     {
         default: break;
         case GlobalConstants.ListNames.ControlMeasures:
             {
             }
             break;
         case GlobalConstants.ListNames.Request:
             {
             }
             break;
         case GlobalConstants.ListNames.Inbox:
             {
             }
             break;
         case GlobalConstants.ListNames.Outbox:
             {
             }
             break;
     }
     return result;
 }
Exemplo n.º 37
0
        /// <summary>
        /// Метод возвращает необходимые состояния кнопок для карточки ЗТ
        /// </summary>
        /// <param name="Item">Текущий Item</param>
        /// <param name="State">Текущий статус карточки</param>
        /// <returns></returns>
        private static AccessData GetRequestAccessData(SPWeb Web, SPGroup Group, SPListItem Item, CardState State, List<string> Companies)
        {
            AccessData result = new AccessData();

            bool IsExpert = Group.Name == GlobalConstants.Groups.Expert;

            bool InCompany = Companies.Any(Company => Item[GlobalConstants.Request_Fields.CompanyTitle].ToString().Contains(Company));

            bool Responsible = new SPFieldUserValue(Web, Item[GlobalConstants.Request_Fields.Responsible].ToString()).User.ID == Web.CurrentUser.ID;

            bool InMailingList = new SPFieldUserValueCollection(Web, Item[GlobalConstants.Request_Fields.MailingList].ToString()).Any(User => User.User.ID == Web.CurrentUser.ID);

            bool AuditorOrAdministrator = Group.Name == GlobalConstants.Groups.Administrator || Group.Name == GlobalConstants.Groups.Auditor;

            //
            //Нужно доделать доступность кнопок в зависимости от дополнительных параметров, как-то : указана ли компания, какой текущий статус карточки и тд тп
            //
            //                                  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

            return result;
        }