コード例 #1
0
ファイル: JobDetail.cs プロジェクト: ChienMaiDinh/da_csnm
 public JobDetail(PlanItem planItem)
 {
     InitializeComponent();
     _userBo   = new User_BO();
     _planItem = planItem;
     Show();
 }
コード例 #2
0
 public AddJob(Socket client, DateTime dateTime)
 {
     _userBO     = new User_BO();
     _planItemBO = new PlanItem_BO();
     _client     = client;
     _dateTime   = dateTime;
     InitializeComponent();
     Load_User();
     cb_status.DataSource    = PlanItem.ListStatus;
     cb_status.SelectedIndex = 0;
     _plan_Item = null;
 }
コード例 #3
0
 public AddJob(Socket client, DateTime dateTime, PlanItem planItem)
 {
     _userBO     = new User_BO();
     _planItemBO = new PlanItem_BO();
     _client     = client;
     _dateTime   = dateTime;
     _plan_Item  = planItem;
     InitializeComponent();
     cb_status.DataSource = PlanItem.ListStatus;
     Load_User();
     Show();
     cb_status.DataSource = PlanItem.ListStatus;
 }
コード例 #4
0
ファイル: AJob.cs プロジェクト: ChienMaiDinh/da_csnm
        public AJob(PlanItem job, int userId, Socket client)
        {
            InitializeComponent();
            Client = client;
            UserId = userId;
            cbStatus.DataSource = PlanItem.ListStatus;

            this.Job = job;

            ShowInfo();
            context2 = new User_BO();
            context  = new PlanItem_BO();
        }
コード例 #5
0
ファイル: AJobAdmin.cs プロジェクト: ChienMaiDinh/da_csnm
        public AJobAdmin(PlanItem job, Socket client)
        {
            _user_BO    = new User_BO();
            _planItemBo = new PlanItem_BO();
            InitializeComponent();
            Client = client;
            cbStatus.DataSource = PlanItem.ListStatus;
            Load_User();

            this.Job = job;

            ShowInfo();

            context = new PlanItem_BO();
        }
コード例 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session[Constant.USERNAME] != null && !string.IsNullOrEmpty(Session[Constant.USERNAME].ToString()))
            {
                using (Promotion.DataModel.User_BO objUser_BO = new User_BO())
                {
                    Promotion.DataModel.User objUser = objUser_BO.GetByUserName(Session[Constant.USERNAME].ToString());
                    if (objUser != null)
                    {
                        if (objUser.Permisions != null)
                        {
                            bool hasPer = false;
                            foreach (Promotion.DataModel.Permision item in objUser.Permisions)
                            {
                                if (item != null && item.Permision1 == Constant.PERMISION_ADMIN)
                                {
                                    hasPer = true;
                                    break;
                                }
                            }
                            if (!hasPer)
                            {
                                log.Info(Session[Constant.USERNAME].ToString() + " không có quyền truy cập trang " + Page.Title);
                                Page.Response.Redirect(Common.GetRootRequest() + "Account/Login.aspx");
                            }
                        }
                    }
                }
            }
            else
            {
                Page.Response.Redirect(Common.GetRootRequest() + "Account/Login.aspx");
            }

            if (!IsPostBack)
            {
                if (Session[Constant.FULLNAME] != null)
                {
                    lblWelcome.Text = Session[Constant.FULLNAME].ToString();
                }
            }
        }
コード例 #7
0
        public QuanLyLichNhanVien()
        {
            InitializeComponent();
            context  = new PlanItem_BO();
            context2 = new User_BO();
            RegistryKey regkey = Registry.CurrentUser.CreateSubKey("Software\\LapLich");
            //mo registry khoi dong cung win
            RegistryKey regstart = Registry.CurrentUser.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
            string      keyvalue = "1";

            //string subkey = "Software\\ManhQuyen";
            try
            {
                //chen gia tri key
                regkey.SetValue("Index", keyvalue);
                //regstart.SetValue("taoregistrytronghethong", "E:\\Studing\\Bai Tap\\CSharp\\Channel 4\\bai temp\\tao registry trong he thong\\tao registry trong he thong\\bin\\Debug\\tao registry trong he thong.exe");
                regstart.SetValue("LapLich", Application.StartupPath + "\\Lập lịch.exe");
                ////dong tien trinh ghi key
                //regkey.Close();
            }
            catch (System.Exception ex)
            {
            }

            tmNotify.Start();
            AppTime = 0;
            LoadMatrix();

            try
            {
                //Job = DeserializeFromXML(filePath) as PlanData;
                Job = new PlanData()
                {
                    Job = context.GetAllPlanItems()
                };
            }
            catch
            {
                SetDefaultJob();
            }
        }
コード例 #8
0
ファイル: Form1.cs プロジェクト: ChienMaiDinh/da_csnm
        public Form1(int userId)
        {
            context  = new PlanItem_BO();
            context2 = new User_BO();
            InitializeComponent();
            Connect();
            UserId = userId;
            //RegistryKey regkey = Registry.CurrentUser.CreateSubKey("Software\\LapLich");
            //mo registry khoi dong cung win
            //RegistryKey regstart = Registry.CurrentUser.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
            string keyvalue = "1";

            //try
            //{
            //chen gia tri key
            //regkey.SetValue("Index", keyvalue);
            //regstart.SetValue("LapLich", Application.StartupPath + "\\Lập lịch.exe");
            //}
            //catch (System.Exception ex)
            //{
            //}

            tmNotify.Start();
            appTime = 0;
            LoadMatrix();

            try
            {
                Job = new PlanData()
                {
                    Job = context.GetAllPlanItems()
                };
            }
            catch
            {
            }
        }
コード例 #9
0
 public Login()
 {
     context = new User_BO();
     InitializeComponent();
 }