protected void Page_Load(object sender, EventArgs e)
        {
            if (!Authentication.HasResource(User.Identity.Name, "GroupData"))
            {
                Response.Redirect(@"/account/logon.aspx?ReturnUrl=%2f");
            }

            if (!IsPostBack)
            {
                _groupRepo = RepositoryFactory.CreateGroupRepo();
                _rootRepo  = RepositoryFactory.CreateRootRepo();
                //從QueryString取得 群組代碼
                string groupType = String.IsNullOrEmpty(Request["GroupType"]) ? String.Empty : Request["GroupType"].ToString();

                //存取資源  與下拉式選單綁定
                ViewUtils.SetOptions(Resource, _rootRepo.GetSystemArchitecture());

                PageTitle.Value = "群組資料 > 新增";

                if (!String.IsNullOrWhiteSpace(groupType))
                {
                    //將 viewModel 的值綁定到 頁面上
                    WebUtils.PageDataBind(_groupRepo.GetGroupData(groupType), this.Page);

                    GroupType.ReadOnly = true;
                    PageTitle.Value    = "群組資料 > 編輯";
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _trainDetaiRepo = RepositoryFactory.CreateTrainDetailRepo();
            _rootRepo       = RepositoryFactory.CreateRootRepo();
            if (!Authentication.HasResource(User.Identity.Name, "TrainDetail01"))
            {
                Response.Redirect(@"/account/logon.aspx?ReturnUrl=%2f");
            }
            if (!IsPostBack)
            {
                PageTitle.Value = "學員意見調查維護 > 編輯";

                string CLID            = String.IsNullOrEmpty(Request["CLID"]) ? String.Empty : Request["CLID"].ToString();
                string SID             = String.IsNullOrEmpty(Request["SID"]) ? String.Empty : Request["SID"].ToString();
                var    employeeData    = _rootRepo.QueryForEmployeeByEmpID(SID);
                string DepartmentID_FK = employeeData != null ? employeeData["DepartmentID_FK"].ToString() : String.Empty;
                model = _trainDetaiRepo.GetDetail(CLID, SID, DepartmentID_FK);
                // 取得 QueryString
                //var paggerParms = WebUtils.ParseQueryString<PaggerParms>(Page.Request);
                //var signListParms = WebUtils.ParseQueryString<SignListParms>(Page.Request);
                //signListParms.Member = Authentication.GetMemberViewModel(User.Identity.Name);
                //signListParms.GridView = TrainDetailGridView;
                //signListParms.PaginationBar = paginationBar;
                //paggerParms.OrderField = "qno";


                ////建構頁面
                //ConstructPage(signListParms, paggerParms, RepositoryFactory.CreateTrainDetailRepo());
                WebUtils.PageDataBind(model, this.Page);
                SaveBtn.Attributes.Add("onclick ", "return confirm( '提醒:送出後就不可更改,確定要送出嗎?');");
            }
            PageInit();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Authentication.HasResource(User.Identity.Name, "AgentData"))
            {
                Response.Redirect(@"/account/logon.aspx?ReturnUrl=%2f");
            }

            if (!IsPostBack)
            {
                _agentRepo = RepositoryFactory.CreateAgentRepo();
                _rootRepo  = RepositoryFactory.CreateRootRepo();
                //從QueryString取得 部門代碼
                string sn = String.IsNullOrEmpty(Request["sn"]) ? String.Empty : Request["sn"].ToString();

                //將員工資料 與下拉式選單綁定
                ViewUtils.SetOptions(EmployeeID_FK, _rootRepo.GetEmployee());

                PageTitle.Value = "代理簽核資料 > 新增";

                if (!String.IsNullOrWhiteSpace(sn))
                {
                    //將 viewModel 的值綁定到 頁面上
                    WebUtils.PageDataBind(_agentRepo.GetAgentData(sn), this.Page);
                    EmployeeName.Value = EmployeeID_FK.Text;

                    PageTitle.Value = "代理簽核資料 > 編輯";
                }
            }
        }
コード例 #4
0
 public TrainDetailRepository(DB dc, RootRepository rootRepo, ProcessWorkflowRepository pwfRepo)
 {
     _dc       = dc;
     _rootRepo = rootRepo;
     _pwfRepo  = pwfRepo;
     var result = _dc.TestConnection();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            _trainDetaiRepo = RepositoryFactory.CreateTrainDetailRepo();
            if (!Authentication.HasResource(User.Identity.Name, "ProcessWorkflowList"))
            {
                Response.Redirect(@"/account/logon.aspx?ReturnUrl=%2f");
            }

            if (!IsPostBack)
            {
                _processwfRepo = RepositoryFactory.CreateProcessWorkflowRepo();
                _rootRepo      = RepositoryFactory.CreateRootRepo();

                //從QueryString取得 簽核文件代碼
                if (String.IsNullOrWhiteSpace(Request["SignDocID"]))
                {
                    Response.Write("需要簽核文件代碼!".ToAlertFormat());
                    return;
                }

                ProcessWorkflowViewModel model = _processwfRepo.GetWorkflowDataAndCheck(Request["SignDocID"], User.Identity.Name);
                if (model == null)
                {
                    Response.Write("查無簽核流程資料!".ToAlertFormat());
                    return;
                }

                //將 viewModel 的值綁定到 頁面上
                WebUtils.PageDataBind(model, this.Page);
                SignDocID_FK.Value = model.SignDocID;

                FormContent1.Attributes.Add("Src", ConstructAspxPage(model.SignDocID, model.FormID_FK));
            }
            PageInit();
        }
コード例 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Authentication.HasResource(User.Identity.Name, "Overtime"))
            {
                Response.Redirect(@"/account/logon.aspx?ReturnUrl=%2f");
            }

            if (!IsPostBack)
            {
                //進入新增頁面
                _overtimeRepo = RepositoryFactory.CreateOvertimeRepo();
                _rootRepo     = RepositoryFactory.CreateRootRepo();

                //將部門資料 與下拉式選單綁定
                ViewUtils.SetOptions(DefaultDeptName, _rootRepo.GetDepartment());
                //將支援部門資料 與下拉式選單綁定
                ViewUtils.SetOptions(DefaultSupportDeptName, _rootRepo.GetDepartment());
                //20161117 修改抓成本部門
                //ViewUtils.SetOptions(DefaultSupportDeptName, _rootRepo.GetCostDepartment());
                //將訂餐資料 與下拉式選單綁定
                ViewUtils.SetOptions(DefaultMealOrderValue, _overtimeRepo.CreateMealOrderType());
                //將報酬資料 與下拉式選單綁定
                ViewUtils.SetOptions(DefaultPayTypeValue, _overtimeRepo.CreatePayType());

                var employeeData = _rootRepo.QueryForEmployeeByADAccount(User.Identity.Name);
                ApplyID_FK.Value = employeeData != null ? employeeData["EmployeeID"].ToString() : String.Empty;
                ApplyName.Text   = employeeData != null ? employeeData["EmployeeName"].ToString() : String.Empty;

                var deptData = _rootRepo.QueryForDepartmentByDeptID(employeeData != null ? employeeData["departmentID_FK"].ToString() : String.Empty);
                ApplyDeptID_FK.Value          = deptData != null ? deptData["DepartmentID"].ToString() : String.Empty;
                ApplyDeptName.Text            = deptData != null ? deptData["DepartmentName"].ToString() : String.Empty;
                DefaultDeptName.SelectedValue = !String.IsNullOrWhiteSpace(ApplyDeptID_FK.Value) ? ApplyDeptID_FK.Value : String.Empty;
                //20161117 支援單位預設值抓成本部門(已取消此做法)
                DefaultSupportDeptName.SelectedValue = !String.IsNullOrWhiteSpace(ApplyDeptID_FK.Value) ? ApplyDeptID_FK.Value : String.Empty;
                //DefaultSupportDeptName.SelectedValue = employeeData != null ? employeeData["CostDepartmentID"].ToString() : String.Empty;
                if (employeeData["CostDepartmentID"].ToString().Substring(0, 2) == "39")
                {
                    DefaultMealOrderValue.SelectedValue = "none";
                }
                else
                {
                    DefaultMealOrderValue.SelectedValue = "Carnivore";
                }
                DefaultPayTypeValue.SelectedValue = "overtimePay";
                DefaultStartDateTime.Text         = DateTime.Now.ToString("yyyy-MM-dd 17:20:00");
                DefaultEndDateTime.Text           = DateTime.Now.ToString("yyyy-MM-dd 19:20:00");
                PageTitle.Value  = "表單新增作業 > 加班單";
                FormSeries.Value = "Overtime";
                DefaultSupportDeptName_SelectedIndexChanged(sender, e);
                string signDocID = String.IsNullOrEmpty(Request["SignDocID_FK"]) ? String.Empty : Request["SignDocID_FK"].ToString();
                if (!String.IsNullOrWhiteSpace(signDocID))
                {
                    PageTitle.Value = "表單編輯作業 > 加班單";
                    SignDocID.Value = signDocID;
                }
            }
        }
        public ProcessWorkflowDetailViewModel PageDataBind()
        {
            _rootRepo = RepositoryFactory.CreateRootRepo();
            var empData = _rootRepo.QueryForEmployeeByADAccount(User.Identity.Name);
            var model   = WebUtils.ViewModelMapping <ProcessWorkflowDetailViewModel>(this.Page);

            model.ChiefID_FK = empData != null ? empData["EmployeeID"].ToString() : String.Empty;
            model.Modifier   = User.Identity.Name;
            return(model);
        }
コード例 #8
0
        public async Task ProcessRoot(List <Core.Root> roots)
        {
            using (var context = new JonasTest.Data.Model.ScoreCardContext())
            {
                var repository = new RootRepository(context);
                await repository.AddRange(roots);

                await context.SaveChangesAsync();
            }
        }
        public OvertimeRepository(DB dc, RootRepository rootRepo, ProcessWorkflowRepository pwfRepo)
        {
            _dc = dc;

            //草稿
            status          = "1";
            currentDateTime = DateTime.Now;
            _rootRepo       = rootRepo;
            _pwfRepo        = pwfRepo;
            _log            = NLog.LogManager.GetCurrentClassLogger();
        }
コード例 #10
0
        private void SeedOrder()
        {
            var newCourse = Order.Create(FakeOrderId, new CustomerId(Guid.NewGuid().ToString()),
                                         "Amsterdam", "Fake-1", SystemClock.Now);

            RootRepository.AddAsync(newCourse.State, FakeOrderId)
            .GetAwaiter().GetResult();

            UnitOfWork.SaveChangesAsync()
            .GetAwaiter().GetResult();
        }
コード例 #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Authentication.HasResource(User.Identity.Name, "bbs_contentList"))
            {
                Response.Redirect(@"/account/logon.aspx?ReturnUrl=%2f");
            }
            if (!IsPostBack)
            {
                _bbsRepo  = RepositoryFactory.CreateBbsRepo();
                _rootRepo = RepositoryFactory.CreateRootRepo();
                //從QueryString取得 公佈欄代碼
                string bbsID = String.IsNullOrEmpty(Request["BbsID"]) ? String.Empty : Request["BbsID"].ToString();

                PageTitle.Value = "公佈欄 > 新增";

                if (!String.IsNullOrWhiteSpace(bbsID))
                {
                    model           = _bbsRepo.GetBbs(bbsID);
                    PageTitle.Value = "公佈欄 > 編輯";

                    if (model.PhotoName != "")
                    {
                        HyperLink_FILENAME1.Visible     = true;
                        HyperLink_FILENAME1.NavigateUrl = @"..\..\Upload\" + model.PhotoName;
                        Button_DelFILE1.Visible         = true;
                        File_Photo.Visible = false;
                    }
                    else
                    {
                        HyperLink_FILENAME1.Visible = false;
                        Button_DelFILE1.Visible     = false;
                        File_Photo.Visible          = true;
                    }

                    if (model.UpName != "")
                    {
                        HyperLink_FILENAME2.Visible     = true;
                        HyperLink_FILENAME2.NavigateUrl = @"..\..\Upload\" + model.UpName;
                        Button_DelFILE2.Visible         = true;
                        File_Up1.Visible = false;
                    }
                    else
                    {
                        HyperLink_FILENAME2.Visible = false;
                        Button_DelFILE2.Visible     = false;
                        File_Up1.Visible            = true;
                    }

                    WebUtils.PageDataBind(_bbsRepo.GetBbsData(bbsID), this.Page);
                }
            }
        }
コード例 #12
0
        /// <summary>
        /// GridView.RowCommand 事件 .NET Framework (current version)  發生於在按一下按鈕時 GridView 控制項。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void WorkflowQueryGridView_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            _rootRepo = RepositoryFactory.CreateRootRepo();
            GridViewRow row                    = (GridViewRow)((Control)e.CommandSource).NamingContainer;
            string      DocId                  = WorkflowQueryGridView.DataKeys[row.RowIndex].Values["SignDocID"].ToString();
            string      FormID                 = WorkflowQueryGridView.DataKeys[row.RowIndex].Values["FormID_FK"].ToString();
            string      employeeID             = WorkflowQueryGridView.DataKeys[row.RowIndex].Values["EmployeeID_FK"].ToString();
            string      UserName               = User.Identity.Name.ToString();
            string      CurrentSignLevelDeptID = WorkflowQueryGridView.DataKeys[row.RowIndex].Values["CurrentSignLevelDeptID_FK"].ToString();
            string      Remainder              = WorkflowQueryGridView.DataKeys[row.RowIndex].Values["Remainder"].ToString();
            string      ChiefID                = WorkflowQueryGridView.DataKeys[row.RowIndex].Values["ChiefID_Up"].ToString();

            if (e.CommandName == "Pump")
            {
                //Response.Write("<script language=javascript>alert('" + UserName + "')</script>");
                var responseMessage = String.Empty;
                try
                {
                    MailInfo info = new MailInfo()
                    {
                        AddresseeTemp = System.Web.Configuration.WebConfigurationManager.AppSettings["MailTemplate"],
                        DomainPattern = ConfigUtils.ParsePageSetting("Pattern")["DomainPattern"],
                    };
                    _rootRepo.PumpData(DocId, FormID, employeeID, UserName, CurrentSignLevelDeptID, Remainder);
                    info.To = (string)_rootRepo.QueryForEmployeeByEmpID(ChiefID)["ADAccount"];

                    info.Subject = String.Format("系統提醒!簽核單號 : {0} 已經由填單者抽單!", DocId);
                    info.Body.AppendFormat("{0}{1}", info.Subject, "此件為系統發送,請勿回覆!");

                    //mail
                    _mailer = new Mailer(info);
                    if (PublicRepository.CurrentWorkflowMode == Enums.WorkflowTypeEnum.RELEASE)
                    {
                        _mailer.SendMail();
                    }
                    //log
                    var cc = String.Join(",", info.To);
                    _log.Trace(String.Format("MailTo : {0}\r\ncc : {1}\r\nTitle : {2}\r\nContent : {3}\r\n", info.To, cc, info.Subject, info.Body));

                    Response.Write("<script language=javascript>alert('成功抽單!')</script>");
                }
                catch (Exception ex)
                {
                    Response.Write("<script language=javascript>alert('抽單失敗!\r\n錯誤訊息: '" + ex.Message + ")</script>");
                }
                finally
                {
                    Response.Write("<script language=javascript>window.location.href='WorkflowQueryList.aspx'</script>");
                }
            }
        }
コード例 #13
0
 public string GetFormUrl(object docID, object employeeID, object formID)
 {
     _rootRepo = RepositoryFactory.CreateRootRepo();
     if (String.IsNullOrWhiteSpace((string)docID))
     {
         return("無此簽核號碼".ToAlertFormat());
     }
     else
     {
         //簽核紀錄查詢 > 列表的表單明細Url
         var pageSet = ConfigUtils.ParsePageSetting("WorkflowListSetting");
         var result  = String.Format(pageSet[formID.ToString()], docID, employeeID);
         return(result);
     }
 }
コード例 #14
0
        protected void DefaultSupportDeptName_SelectedIndexChanged(object sender, EventArgs e)
        {
            //20161121 add尋找支援部門實際對應的成本部門
            _rootRepo = RepositoryFactory.CreateRootRepo();
            var    DeptDataLevel   = _rootRepo.QueryForDepartmentByDeptID(DefaultSupportDeptName.Text);
            string Level           = DeptDataLevel != null ? DeptDataLevel["DepartmentLevel"].ToString() : String.Empty;
            string TrueSupportDept = "";

            if (DeptDataLevel["Virtual"].ToString() == "N")
            {
                TrueSupportDept = DeptDataLevel["DepartmentID"].ToString();
            }
            else
            {
                string UpDept = "";
                for (int i = Int32.Parse(Level) - 1; i >= 1; i--)
                {
                    if (UpDept == "")
                    {
                        var DeptData = _rootRepo.QueryForDepartmentByDeptID(DeptDataLevel["UpperDepartmentID"].ToString());
                        if (DeptData["Virtual"].ToString() == "N")
                        {
                            TrueSupportDept = DeptData["DepartmentID"].ToString();
                            break;
                        }
                        else
                        {
                            UpDept = DeptData["UpperDepartmentID"].ToString();
                        }
                    }
                    else
                    {
                        var DeptData = _rootRepo.QueryForDepartmentByDeptID(UpDept);
                        if (DeptData["Virtual"].ToString() == "N")
                        {
                            TrueSupportDept = DeptData["DepartmentID"].ToString();
                            break;
                        }
                        else
                        {
                            UpDept = DeptData["UpperDepartmentID"].ToString();
                        }
                    }
                }//迴圈END
            }

            TrueSupportDeptName.Value = TrueSupportDept;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                _rootRepo = RepositoryFactory.CreateRootRepo();

                if (!String.IsNullOrWhiteSpace(Request["UserID"]))
                {
                    //ddl_DeptUser_SelectedIndexChanged(sender,e);
                    var employeeData = _rootRepo.QueryForEmployeeByEmpID(Request["UserID"]);
                    lbl_UserID.Text            = employeeData["EmployeeID"].ToString();
                    lbl_UserName.Text          = employeeData["EmployeeName"].ToString();
                    ddl_DeptUser.SelectedValue = Request["UserID"];
                    DeptUserName.Value         = ddl_DeptUser.Text;

                    //將主管資料 與下拉式選單綁定
                    ViewUtils.SetOptions(ddl_DeptUser, _rootRepo.GetDeptEmployee(employeeData["CostDepartmentID"].ToString()));
                    ddl_DeptUser.Items.Remove(ddl_DeptUser.Items.FindByValue(""));
                    //1.各月出勤統計
                    var paggerParms_Monthly   = WebUtils.ParseQueryString <PaggerParms>(Page.Request);
                    var signListParms_Monthly = WebUtils.ParseQueryString <SignListParms>(Page.Request);
                    signListParms_Monthly.Member        = Authentication.GetMemberViewModel(User.Identity.Name);
                    signListParms_Monthly.EmployeeID_FK = employeeData["EmployeeID"].ToString();
                    signListParms_Monthly.PageName      = "Monthly_Result";
                    signListParms_Monthly.GridView      = MonthlyGridView;
                    //signListParms_Daily.PaginationBar_Daily = paginationBar_Daily;
                    //建構頁面
                    ConstructPage(signListParms_Monthly, paggerParms_Monthly, RepositoryFactory.CreateMonthlyRepo());

                    //2.特休
                    var paggerParms_Recreate   = WebUtils.ParseQueryString <PaggerParms>(Page.Request);
                    var signListParms_Recreate = WebUtils.ParseQueryString <SignListParms>(Page.Request);
                    signListParms_Recreate.Member        = Authentication.GetMemberViewModel(User.Identity.Name);
                    signListParms_Recreate.EmployeeID_FK = employeeData["EmployeeID"].ToString();
                    signListParms_Recreate.PageName      = "Recreate_Result";
                    signListParms_Recreate.GridView      = RecreateGridView;
                    //signListParms_Daily.PaginationBar_Daily = paginationBar_Daily;
                    //建構頁面
                    ConstructPage(signListParms_Recreate, paggerParms_Recreate, RepositoryFactory.CreateRecreateRepo());
                    //20170524 換休時數
                    var dateTimeNow = DateTime.Now;
                    var t           = _rootRepo.Find_ADDOFFHOURS(employeeData["EmployeeID"].ToString(), dateTimeNow.ToString("yyyyMMdd"));
                    lb_ADDOFFHOURS.Text = _rootRepo.Find_ADDOFFHOURS(employeeData["EmployeeID"].ToString(), dateTimeNow.ToString("yyyyMMdd"));
                }
            }
        }
コード例 #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Authentication.HasResource(User.Identity.Name, "OvertimeList"))
            {
                Response.Redirect(@"/account/logon.aspx?ReturnUrl=%2f");
            }

            if (!IsPostBack)
            {
                _overitmeRepo = RepositoryFactory.CreateOvertimeRepo();
                _rootRepo     = RepositoryFactory.CreateRootRepo();
                _smartRepo    = RepositoryFactory.CreateSmartManRepo();

                // 取得 QueryString
                var paggerParms   = WebUtils.ParseQueryString <PaggerParms>(Page.Request);
                var signListParms = WebUtils.ParseQueryString <SignListParms>(Page.Request);
                signListParms.GridView      = OvertimeGridView;
                signListParms.PaginationBar = paginationBar;

                //根據查詢的 簽核代碼 搜尋加班單
                var pagination = _overitmeRepo.GetOvertimeListPagination(signListParms, paggerParms);

                if (pagination == null)
                {
                    return;
                }

                //設定 gridView Source
                ViewUtils.SetGridView(OvertimeGridView, pagination.Data);

                //Pagination Bar Generator
                string paginationHtml = WebUtils.GetPagerNumericString(pagination, Request);
                paginationBar.InnerHtml = paginationHtml;


                model = _overitmeRepo.GetWorkflowData(signListParms.SignDocID);
                WebUtils.PageDataBind(model, this.Page);
                Signed.NavigateUrl = "~/Area/Sign/WorkflowDetail.aspx?signDocID=" + signListParms.SignDocID;
                if (model == null)
                {
                    return;
                }
                var employeeData = _rootRepo.QueryForEmployeeByEmpID(model.EmployeeID_FK);
                ApplyName.Text = employeeData != null ? employeeData["EmployeeName"].ToString() : String.Empty;
            }
        }
コード例 #17
0
        public string GetEditUrl(object docID, object formID)
        {
            _rootRepo = RepositoryFactory.CreateRootRepo();
            if (String.IsNullOrWhiteSpace((string)docID))
            {
                return("無此簽核號碼".ToAlertFormat());
            }
            else
            {
                var profileData = Authentication.LoginList.ContainsKey(User.Identity.Name) ? Authentication.LoginList[User.Identity.Name] : null;
                var employeeID  = profileData != null?String.Join("", profileData["EmployeeID"]) : null;

                //簽核紀錄查詢 > 列表的編輯Url
                var pageSet = ConfigUtils.ParsePageSetting("WorkflowEditSetting");
                var result  = String.Format(pageSet[formID.ToString()], docID, employeeID);
                return(result);
            }
        }
コード例 #18
0
        private ForgotPunchViewModel viewModelMapping(Page page)
        {
            if (_rootRepo == null)
            {
                _rootRepo = RepositoryFactory.CreateRootRepo();
            }

            var model = WebUtils.ViewModelMapping <ForgotPunchViewModel>(page);
            //根據表單系列決定 SignType Data
            var signTypeData = _rootRepo.QueryForSignTypeDataBySeries(model.FormSeries);

            model.Creator   = User.Identity.Name;
            model.Modifier  = User.Identity.Name;
            model.FormID_FK = Int32.Parse(signTypeData["FormID"].ToString());
            model.RuleID_FK = signTypeData["SignID_FK"].ToString();

            return(model);
        }
コード例 #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //驗證身分權限
            if (!Authentication.HasResource(User.Identity.Name, "EmployeeData"))
            {
                Response.Redirect(@"/account/logon.aspx?ReturnUrl=%2f");
            }

            //表單第一次載入
            if (!IsPostBack)
            {
                _employeeRepo = RepositoryFactory.CreateEmployeeRepo();
                _rootRepo     = RepositoryFactory.CreateRootRepo();
                //從QueryString取得 員工編號
                string empID = String.IsNullOrEmpty(Request["EmployeeID"]) ? String.Empty : Request["EmployeeID"].ToString();

                //將部門資料 與下拉式選單綁定
                ViewUtils.SetOptions(DepartmentID_FK, _rootRepo.GetDepartment());
                //將成本部門資料 與下拉式選單綁定
                ViewUtils.SetOptions(CostDepartmentID, _rootRepo.GetCostDepartment());
                //代理人資料 與下拉式選單綁定
                ViewUtils.SetOptions(AgentName, _rootRepo.GetEmployee());
                //權限類別  與下拉式選單綁定
                ViewUtils.SetOptions(AccessType, _rootRepo.GetGroup());
                //國籍類別  與下拉式選單綁定
                ViewUtils.SetOptions(NationalType, _employeeRepo.GenarationNationalType());
                //性別類別  與下拉式選單綁定
                ViewUtils.SetOptions(SexType, _employeeRepo.GenarationSexType());

                PageTitle.Value = "員工基本資料 > 新增";

                if (!String.IsNullOrWhiteSpace(empID))
                {
                    //將 viewModel 的值綁定到 頁面上
                    WebUtils.PageDataBind(_employeeRepo.GetEmployeeDataByID(empID), this.Page);

                    EmployeeID.ReadOnly      = true;
                    DepartmentName.Value     = DepartmentID_FK.Text;
                    CostDepartmentName.Value = CostDepartmentID.Text;
                    PageTitle.Value          = "員工基本資料 > 編輯";
                }
            }
        }
コード例 #20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _forgotRepo  = RepositoryFactory.CreateForgotPunchRepo();
            _rootRepo    = RepositoryFactory.CreateRootRepo();
            _smartRepo   = RepositoryFactory.CreateSmartManRepo();
            _employeeRow = _smartRepo.QueryForEmployee(EmployeeID_FK.Text);

            if (!Authentication.HasResource(User.Identity.Name, "ForgotPunch"))
            {
                Response.Redirect(@"/account/logon.aspx?ReturnUrl=%2f");
            }

            if (!IsPostBack)
            {
                string signDocID = String.IsNullOrEmpty(Request["SignDocID_FK"]) ? String.Empty : Request["SignDocID_FK"].ToString();

                //將部門資料 與下拉式選單綁定
                ViewUtils.SetOptions(DepartmentID_FK, _rootRepo.GetDepartment());
                //忘刷員工資料 與下拉式選單綁定
                ViewUtils.SetOptions(EmployeeID_FK, _rootRepo.GetEmployee());
                //忘刷類型資料 與下拉式選單綁定
                ViewUtils.SetOptions(PeriodType, _rootRepo.GetPeriodType());

                var employeeData = _rootRepo.QueryForEmployeeByADAccount(User.Identity.Name);
                ApplyID_FK.Text               = employeeData != null ? employeeData["EmployeeID"].ToString() : String.Empty;
                ApplyName.Text                = employeeData != null ? employeeData["EmployeeName"].ToString() : String.Empty;
                ApplyDateTime.Text            = DateTime.Now.FormatDatetime();
                EmployeeID_FK.SelectedValue   = employeeData != null ? employeeData["EmployeeID"].ToString() : String.Empty;
                DepartmentID_FK.SelectedValue = employeeData != null ? employeeData["DepartmentID_FK"].ToString() : String.Empty;
                PageTitle.Value               = "表單新增作業 > 忘刷單";
                FormSeries.Value              = "ForgotPunch";

                if (!String.IsNullOrWhiteSpace(signDocID))
                {
                    //將 viewModel 的值綁定到 頁面上
                    WebUtils.PageDataBind(_forgotRepo.GetForgotPunchForm(signDocID), this.Page);

                    SignDocID_FK.Text = signDocID;
                    PageTitle.Value   = "表單編輯作業 > 忘刷單";
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _trainDetaiRepo = RepositoryFactory.CreateTrainDetailRepo();
            _rootRepo       = RepositoryFactory.CreateRootRepo();
            if (!Authentication.HasResource(User.Identity.Name, "TrainDetail02"))
            {
                Response.Redirect(@"/account/logon.aspx?ReturnUrl=%2f");
            }
            if (!IsPostBack)
            {
                string signDocID = String.IsNullOrEmpty(Request["SignDocID_FK"]) ? String.Empty : Request["SignDocID_FK"].ToString();
                PageTitle.Value  = "受訓心得報告維護 > 編輯";
                FormSeries.Value = "Train";

                string CLID            = String.IsNullOrEmpty(Request["CLID"]) ? String.Empty : Request["CLID"].ToString();
                string SID             = String.IsNullOrEmpty(Request["SID"]) ? String.Empty : Request["SID"].ToString();
                var    employeeData    = _rootRepo.QueryForEmployeeByEmpID(SID);
                string DepartmentID_FK = employeeData != null ? employeeData["DepartmentID_FK"].ToString() : String.Empty;
                model = _trainDetaiRepo.GetDetail(CLID, SID, DepartmentID_FK);

                // 取得 QueryString
                //var paggerParms = WebUtils.ParseQueryString<PaggerParms>(Page.Request);
                //var signListParms = WebUtils.ParseQueryString<SignListParms>(Page.Request);
                //signListParms.Member = Authentication.GetMemberViewModel(User.Identity.Name);
                //signListParms.GridView = TrainDetailGridView;
                //signListParms.PaginationBar = paginationBar;
                //paggerParms.OrderField = "qno";

                ////建構頁面
                //ConstructPage(signListParms, paggerParms, RepositoryFactory.CreateTrainDetailRepo());
                WebUtils.PageDataBind(model, this.Page);
                if (!String.IsNullOrWhiteSpace(signDocID))
                {
                    //將 viewModel 的值綁定到 頁面上
                    WebUtils.PageDataBind(_trainDetaiRepo.GetData(signDocID), this.Page);

                    SignDocID_FK.Text = signDocID;
                    PageTitle.Value   = "表單編輯作業 > 忘刷單";
                }
            }
            PageInit();
        }
コード例 #22
0
        //Logical.Notice no = new global::MyforepiNotice_Project.Logical.Notice();
        protected void Page_Load(object sender, EventArgs e)
        {
            _rootRepo = RepositoryFactory.CreateRootRepo();
            if (!IsPostBack)
            {
                //1.Daily
                // 取得 QueryString
                var employeeData = _rootRepo.QueryForEmployeeByADAccount(User.Identity.Name);



                var paggerParms_Daily   = WebUtils.ParseQueryString <PaggerParms>(Page.Request);
                var signListParms_Daily = WebUtils.ParseQueryString <SignListParms>(Page.Request);
                signListParms_Daily.Member        = Authentication.GetMemberViewModel(User.Identity.Name);
                signListParms_Daily.EmployeeID_FK = employeeData["EmployeeID"].ToString();

                signListParms_Daily.PageName = "Default";
                //signListParms_Daily.Member.EmployeeID = employeeData["EmployeeID"].ToString();
                signListParms_Daily.GridView = DailyGridView;
                //signListParms_Daily.PaginationBar_Daily = paginationBar_Daily;
                //建構頁面
                ConstructPage_Daily(signListParms_Daily, paggerParms_Daily, RepositoryFactory.CreateMonthlyRepo());
                //2.bbs
                // 取得 QueryString
                var paggerParms   = WebUtils.ParseQueryString <PaggerParms>(Page.Request);
                var signListParms = WebUtils.ParseQueryString <SignListParms>(Page.Request);
                signListParms.Member   = Authentication.GetMemberViewModel(User.Identity.Name);
                signListParms.GridView = BbsGridView;
                //signListParms.TotalRowsCount = totalRowsCount;
                signListParms.PaginationBar = paginationBar;
                //signListParms.NoDataTip = noDataTip;

                //建構頁面
                ConstructPage(signListParms, paggerParms, RepositoryFactory.CreateBbsListRepo());
                Monthly.NavigateUrl = "Monthly_Result.aspx?UserID=" + employeeData["EmployeeID"].ToString();
                //pageSizeSelect.Text = paggerParms.PageSize.ToString();
                //queryTextBox.Text = signListParms.QueryText;
            }
        }
コード例 #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Authentication.HasResource(User.Identity.Name, "SalaryLimit"))
            {
                Response.Redirect(@"/account/logon.aspx?ReturnUrl=%2f");
            }

            if (!IsPostBack)
            {
                _salaryRepo = RepositoryFactory.CreateSalaryLimitRepo();
                _rootRepo   = RepositoryFactory.CreateRootRepo();
                //從QueryString取得 部門代碼

                PageTitle.Value = "基本設定 > 結薪日資料維護";

                var data = _salaryRepo.GetLimitData("1");
                if (data != null)
                {
                    //將 viewModel 的值綁定到 頁面上
                    WebUtils.PageDataBind(data, this.Page);
                }
            }
        }
コード例 #24
0
        /// <summary>
        /// GridView.RowDeleting 事件.NET Framework (current version)  發生於按一下的資料列的 [刪除] 按鈕前, GridView 控制項刪除資料列。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void WorkflowQueryGridView_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            _rootRepo = RepositoryFactory.CreateRootRepo();
            string DocId = WorkflowQueryGridView.DataKeys[e.RowIndex].Values["SignDocID"].ToString();

            var responseMessage = String.Empty;

            try
            {
                if (!String.IsNullOrEmpty(DocId))
                {
                    _rootRepo.DelData(DocId);
                    Response.Write("<script language=javascript>alert('刪除成功!')</script>");
                }
            }
            catch (Exception ex)
            {
                Response.Write("<script language=javascript>alert('刪除失敗!\r\n錯誤訊息: '" + ex.Message + ")</script>");
            }
            finally
            {
                Response.Write("<script language=javascript>window.location.href='WorkflowQueryList.aspx'</script>");
            }
        }
コード例 #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Authentication.HasResource(User.Identity.Name, "DepartmentData"))
            {
                Response.Redirect(@"/account/logon.aspx?ReturnUrl=%2f");
            }

            if (!IsPostBack)
            {
                _departmentRepo = RepositoryFactory.CreateDepartmentRepo();
                _rootRepo       = RepositoryFactory.CreateRootRepo();
                //從QueryString取得 部門代碼
                string deptID = String.IsNullOrEmpty(Request["DepartmentID"]) ? String.Empty : Request["DepartmentID"].ToString();

                //將主管資料 與下拉式選單綁定
                ViewUtils.SetOptions(ChiefID_FK, _rootRepo.GetEmployee());
                //部門資料 與下拉式選單綁定
                ViewUtils.SetOptions(UpperDepartmentID, _rootRepo.GetDepartment());
                //將員工資料 與下拉式選單綁定
                ViewUtils.SetOptions(FilingEmployeeID_FK, _rootRepo.GetEmployee());

                PageTitle.Value = "部門基本資料 > 新增";

                if (!String.IsNullOrWhiteSpace(deptID))
                {
                    //將 viewModel 的值綁定到 頁面上
                    WebUtils.PageDataBind(_departmentRepo.GetDepartmentData(deptID), this.Page);

                    DepartmentID.ReadOnly     = true;
                    ChiefName.Value           = ChiefID_FK.Text;
                    UpperDepartmentName.Value = UpperDepartmentID.Text;;
                    FilingEmployeeName.Value  = FilingEmployeeID_FK.Text;
                    PageTitle.Value           = "部門基本資料 > 編輯";
                }
            }
        }
コード例 #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Authentication.HasResource(User.Identity.Name, "TypeData"))
            {
                Response.Redirect(@"/account/logon.aspx?ReturnUrl=%2f");
            }

            if (!IsPostBack)
            {
                _typeRepo = RepositoryFactory.CreateTypeRepo();
                _rootRepo = RepositoryFactory.CreateRootRepo();
                //從QueryString取得 表單簽核類型
                string formIDTxt = String.IsNullOrEmpty(Request["FormID"]) ? String.Empty : Request["FormID"].ToString();

                //將部門資料 與下拉式選單綁定
                ViewUtils.SetOptions(FilingDepartmentID_FK, _rootRepo.GetDepartment());
                //代理人資料 與下拉式選單綁定
                ViewUtils.SetOptions(SignID_FK, _rootRepo.GetSignProcedure());

                PageTitle.Value = "表單類型資料 > 新增";

                if (!String.IsNullOrWhiteSpace(formIDTxt))
                {
                    int formID;
                    if (!Int32.TryParse(formIDTxt, out formID))
                    {
                        return;
                    }
                    //將 viewModel 的值綁定到 頁面上
                    WebUtils.PageDataBind(_typeRepo.GetTypeData(formID), this.Page);

                    FilingDepartmentName.Value = FilingDepartmentID_FK.Text;
                    PageTitle.Value            = "表單類型資料 > 編輯";
                }
            }
        }
コード例 #27
0
 public Train()
 {
     _trainRepo = RepositoryFactory.CreateTrainRepo();
     _rootRepo  = RepositoryFactory.CreateRootRepo();
     GlobalDiagnosticsContext.Set("User", User.Identity.Name);
 }
 public ProcessWorkflowRepository(DB dc, RootRepository rootRepo)
 {
     _dc       = dc;
     _rootRepo = rootRepo;
 }
        public MultiConditions GetOvertimeDML(OvertimeViewModel overtime, DateTime payRange)
        {
            _rootRepo = RepositoryFactory.CreateRootRepo();
            var DeptDataLevel = _rootRepo.QueryForDepartmentByDeptID(overtime.SupportDeptID_FK);
            var dutyWorkData  = _smartRepo.QueryForDutyWork(overtime.StartDateTime.Value.ToDateTimeFormateString("yyyyMMdd"), overtime.EmployeeID_FK);

            overtime.IsHoliday = "Y".Equals(dutyWorkData["HOLIDAY"].ToString());
            var    HolidayType     = dutyWorkData["H_TYPE"].ToString();
            string Level           = DeptDataLevel != null ? DeptDataLevel["DepartmentLevel"].ToString() : String.Empty;
            string TrueSupportDept = "";

            if (DeptDataLevel["Virtual"].ToString() == "N")
            {
                TrueSupportDept = DeptDataLevel["DepartmentID"].ToString();
            }
            else
            {
                string UpDept = "";
                for (int i = Int32.Parse(Level) - 1; i >= 1; i--)
                {
                    if (UpDept == "")
                    {
                        var DeptData = _rootRepo.QueryForDepartmentByDeptID(DeptDataLevel["UpperDepartmentID"].ToString());
                        if (DeptData["Virtual"].ToString() == "N")
                        {
                            TrueSupportDept = DeptData["DepartmentID"].ToString();
                            break;
                        }
                        else
                        {
                            UpDept = DeptData["UpperDepartmentID"].ToString();
                        }
                    }
                    else
                    {
                        var DeptData = _rootRepo.QueryForDepartmentByDeptID(UpDept);
                        if (DeptData["Virtual"].ToString() == "N")
                        {
                            TrueSupportDept = DeptData["DepartmentID"].ToString();
                            break;
                        }
                        else
                        {
                            UpDept = DeptData["UpperDepartmentID"].ToString();
                        }
                    }
                }//迴圈END
            }
            string remark = "";

            if (overtime.Note.Length > 30)
            {
                remark = overtime.Note.Substring(0, 30);
            }
            else
            {
                remark = overtime.Note;
            }

            var        result      = new MultiConditions();
            string     strSQL      = null;
            var        dateTimeNow = DateTime.Now;
            Conditions conditions  = new Conditions()
            {
                { "@SYSTEMDATE", dateTimeNow.ToString("yyyyMMdd") },
                { "@SYSTEMTIME", dateTimeNow.ToString("HHmm") },
                { "@LOGINUSER", "System" },
                { "@APPROVEUSER", "System" },
                { "@APPROVEYN", "Y" },
                { "@COMPANYCD", "A" },
                { "@EMPLOYECD", overtime.EmployeeID_FK },
                { "@PAYYYYYMM", payRange.ToString("yyyyMM") },
                { "@DUTYDATE", overtime.StartDateTime.Value.ToString("yyyyMMdd") },
                { "@BEGINTIME", overtime.BeginTime },
                { "@ENDTIME", overtime.EndTime },
                { "@OVERONWORK", overtime.StartDateTime.Value.ToString("HHmm") },
                { "@OVEROFFWORK", overtime.EndDateTime.Value.ToString("HHmm") },
                { "@OVERWORKHOURS", overtime.TotalHours },
                //20170109 加班說明寫入志元只可30個字
                //{ "@REMARK", overtime.Note.Substring(0,30)},
                { "@REMARK", remark },
                //20161104 修正單號紀錄
                //{ "@SEQNOX", String.Concat("OT",dateTimeNow.ToString("yyyyMMdd"), dateTimeNow.ToString("HHmmss"))},
                { "@SEQNOX", overtime.SignDocID_FK },
                //{ "@HOLIDAY", overtime.IsHoliday },
                { "@HOLIDAY", overtime.IsHoliday ? "Y" : "N" },
                //20161028 修正寫入志元table部門
                //{ "@UNITCD", overtime.DepartmentID_FK},
                { "@UNITCD", overtime.CostDepartmentID },
                { "@COSTCD", TrueSupportDept },
                { "@WORKTYPE", overtime.WorkType },
                { "@H_TYPE", HolidayType },
            };

            string tableName = RepositoryFactory.SmartManConn["DataSource"] + "." + RepositoryFactory.SmartManConn["Catelog"] + ".dbo.DailyOn";

            setConditions(overtime, payRange, ref conditions);

            var dailyOnData = QueryForOvertimeRecord(overtime, tableName);

            if (dailyOnData == null)
            {
                // insert
                strSQL = _dc.ConstructInsertDML(tableName, conditions);
            }
            else
            {
                // update
                var distinglishType  = Double.Parse(dailyOnData["ADDHOURS"].ToString()) > 0 ? "OVERTIMELEAVE" : "OVERTIMEPAY";
                var overonworkArray  = new string[] { overtime.StartDateTime.Value.ToString("HHmm"), (string)dailyOnData["OVERONWORK"] };
                var overoffworkArray = new string[] { overtime.EndDateTime.Value.ToString("HHmm"), (string)dailyOnData["OVEROFFWORK"] };

                //替換加班申請單 開始與結束的時間
                conditions["@OVERONWORK"]  = overonworkArray.Min();
                conditions["@OVEROFFWORK"] = overoffworkArray.Max();

                switch (overtime.PayTypeKey.ToUpper() + distinglishType)
                {
                case "OVERTIMEPAYOVERTIMEPAY":
                    strSQL = String.Format(
                        @"Update {0} Set
SYSTEMDATE = @SYSTEMDATE,
SYSTEMTIME = @SYSTEMTIME,
OVERONWORK  = @OVERONWORK,
OVEROFFWORK = @OVEROFFWORK,
OVERWORKone = OVERWORKone + @OVERWORKone,
OVERWORKtwo = OVERWORKtwo + @OVERWORKtwo,
OVERWORKfour = OVERWORKfour + @OVERWORKfour,
OVERWORKHOURS = OVERWORKHOURS + @OVERWORKHOURS,
REMARK = REMARK +@REMARK
Where EMPLOYECD = @EMPLOYECD and DUTYDATE=@DUTYDATE", tableName);

                    break;

                case "OVERTIMELEAVEOVERTIMELEAVE":

                    strSQL = String.Format(
                        @"Update {0} Set
SYSTEMDATE = @SYSTEMDATE,
SYSTEMTIME = @SYSTEMTIME,
OVERONWORK  = @OVERONWORK,
OVEROFFWORK = @OVEROFFWORK,
OVERWORKHOURS = OVERWORKHOURS + @OVERWORKHOURS,
ADDHOURS = ADDHOURS + @ADDHOURS,
REMARK = REMARK +@REMARK
Where EMPLOYECD = @EMPLOYECD and DUTYDATE=@DUTYDATE ", tableName);

                    break;

                default:
                    throw new Exception("報酬型別選擇錯誤!");
                }
            }

            if (conditions.ContainsKey("@OVERWORKone"))//1.34
            {
                strSQL = strSQL.Replace("OVERWORKone", "OVERWORK1");
                conditions.Add("@OVERWORK1", conditions["@OVERWORKone"]);
                conditions.Remove("@OVERWORKone");
            }
            else
            {
                strSQL = Regex.Replace(strSQL, @"(?m)^OVERWORKone.*?,", "");
            }

            if (conditions.ContainsKey("@OVERWORKtwo"))//1.67
            {
                strSQL = strSQL.Replace("OVERWORKtwo", "OVERWORK2");
                conditions.Add("@OVERWORK2", conditions["@OVERWORKtwo"]);
                conditions.Remove("@OVERWORKtwo");
            }
            else
            {
                strSQL = Regex.Replace(strSQL, @"(?m)^OVERWORKtwo.*?,", "");
            }

            if (conditions.ContainsKey("@OVERWORKthree"))//2.67
            {
                strSQL = strSQL.Replace("OVERWORKthree", "OVERWORK3");
                conditions.Add("@OVERWORK3", conditions["@OVERWORKthree"]);
                conditions.Remove("@OVERWORKthree");
            }
            else
            {
                strSQL = Regex.Replace(strSQL, @"(?m)^OVERWORKthree.*?,", "");
            }

            if (conditions.ContainsKey("@OVERWORKfour"))
            {
                strSQL = strSQL.Replace("OVERWORKfour", "OVERWORK4");
                conditions.Add("@OVERWORK4", conditions["@OVERWORKfour"]);
                conditions.Remove("@OVERWORKfour");
            }
            else
            {
                strSQL = Regex.Replace(strSQL, @"(?m)^OVERWORKfour.*?,", "");
            }

            result.Add(strSQL, conditions);

            return(result);
        }
 public GroupRepository(DB dc, RootRepository rootRepo)
 {
     _dc       = dc;
     _rootRepo = rootRepo;
 }