コード例 #1
0
ファイル: User.aspx.cs プロジェクト: pravastech/TimeSheet
        protected void Page_Load(object sender, EventArgs e)
        {
            string submitKey = (Request.Form["submitKey"] ?? "").ToString();
            if (!string.IsNullOrEmpty(submitKey))
            {
                string allSubmitKeys = (Session["allSubmitKeys"] ?? "").ToString();
                if (!allSubmitKeys.Split(',').Contains(submitKey))
                {
                    Session["allSubmitKeys"] = allSubmitKeys + "," + submitKey;
                    CurrentUser user = new CurrentUser("TimeSheetAdmin");
                    TimeSheetBO.Users userRoleObj = new TimeSheetBO.Users(user);
                    Guid guidfield;
                    Guid.TryParse(Request.Form["guidfield"], out guidfield);
                    userRoleObj.LoadSingle(userRoleObj, " WHERE guidfield = @guidfield", "guidfield", guidfield);
                    userRoleObj.UserName = Request.Form["username"];
                    userRoleObj.FullName = Request.Form["fullname"];
                    userRoleObj.emailAddress = Request.Form["emailAddress"];
                    userRoleObj.Address1 = Request.Form["address1"];
                    userRoleObj.Address2 = Request.Form["address2"];
                    userRoleObj.City = Request.Form["city"];
                    userRoleObj.State = Request.Form["state"];
                    userRoleObj.Role = Request.Form["role"];

                    if (userRoleObj.Save())
                    {

                        ltrMessage.Text = "User saved successfully.";
                    }
                    else
                    {
                        ltrMessage.Text = "Unable to save User information.";
                    }
                }
            }
        }
コード例 #2
0
ファイル: TimeSheetGrid.cs プロジェクト: pravastech/TimeSheet
 public TimeSheetGrid(CurrentUser aUser, String aObjName)
 {
     this.objectName = aObjName;
     this.User = aUser;
     this.allowAdd = true;
     this.allowDelete = false;
     this.allowEdit = true;
 }
コード例 #3
0
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            CurrentUser user = new CurrentUser("TimeSheetAdmin");
            var TimeSheetTaskGrid = TimeSheetGridUtility.TimeSheetTaskGrid(user);
            TimeSheetTaskGrid.allowDelete = true;
            //var UserFields = new UserFields(user).load("", "", "").Cast<UserFields>().ToList();
            var timesheet = new TimeSheetBO.timesheettask(user).Load("", "", "").Cast<TimeSheetBO.timesheettask>().ToList();
            TimeSheetTaskGrid.Rows.AddRange(timesheet);

            ltrGridUI.Text = TimeSheetTaskGrid.gridTable.ToHTML();
            ltrAddNew.Text = "<button type=\"button\" onclick=\"GridUtil.newRow();\">Add New</button>";
            ltrGridScript.Text = JSUtil.encloseInJavascriptTag("gridData = " + TimeSheetTaskGrid.gridJS() + ";\ncolumnJS=[" + TimeSheetTaskGrid.gridTable.columnJS() + "]");
            ltrHiddens.Text = TimeSheetTaskGrid.gridTable.hiddenVars;
        }
コード例 #4
0
ファイル: User.aspx.cs プロジェクト: pravastech/TimeSheet
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            CurrentUser user = new CurrentUser("TimeSheetAdmin"); /* This will change later only test purposes it is here, later it will become login user */
            var UserFieldsGrid = TimeSheetGridUtility.UserFieldsGrid(user);
            UserFieldsGrid.allowDelete = true;
            //var UserFields = new UserFields(user).load("", "", "").Cast<UserFields>().ToList();
            var Users = new TimeSheetBO.Users(user).Load("", "", "").Cast<TimeSheetBO.Users>().ToList();
            UserFieldsGrid.Rows.AddRange(Users);

            ltrGridUI.Text = UserFieldsGrid.gridTable.ToHTML();
            ltrAddNew.Text = "<button type=\"button\" onclick=\"GridUtil.newRow();\">Add New</button>";
            ltrGridScript.Text = JSUtil.encloseInJavascriptTag("gridData = " + UserFieldsGrid.gridJS() + ";\ncolumnJS=[" + UserFieldsGrid.gridTable.columnJS() + "]");
            ltrHiddens.Text = UserFieldsGrid.gridTable.hiddenVars;
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string submitKey = (Request.Form["submitKey"] ?? "").ToString();
            if (!string.IsNullOrEmpty(submitKey))
            {
                string allSubmitKeys = (Session["allSubmitKeys"] ?? "").ToString();
                if (!allSubmitKeys.Split(',').Contains(submitKey))
                {
                    Session["allSubmitKeys"] = allSubmitKeys + "," + submitKey;
                    CurrentUser user = new CurrentUser("TimeSheetAdmin");
                    TimeSheetBO.timesheettask TimeSheetObj = new TimeSheetBO.timesheettask(user);
                    Guid guidfield;
                    Guid.TryParse(Request.Form["guidfield"], out guidfield);
                  string req=  Request.Form["guidfield"];
                    if (!string.IsNullOrEmpty(req))
                    {
                    TimeSheetObj.LoadSingle(TimeSheetObj, " WHERE guidfield = @guidfield", "guidfield", guidfield);
                    }
                    TimeSheetObj.UserName = Request.Form["username"];
                    TimeSheetObj.Projectname = Request.Form["projectname"];
                    TimeSheetObj.Taskname = Request.Form["taskname"];
                    DateTime tdate;
                    DateTime.TryParse(Request.Form["taskDate"],out tdate);
                    DateTime taskdate = new DateTime();
                    TimeSheetObj.Taskdate =  tdate;
                    string strbegintime = Request.Form["taskdate"];
                    TimeSheetObj.Percentage = Request.Form["percentage"];
                    TimeSheetObj.Notes = Request.Form["notes"];
                    TimeSheetObj.CodeSnippet = Request.Form["codesnippet"];
                    //if (TimeSheetObj.username.Length == null)
                    //   {

                    if (TimeSheetObj.Save())
                    {

                        ltrMessage.Text = "TimeSheet saved successfully.";
                    }
                    else
                    {
                        ltrMessage.Text = "Unable to save TimeSheet information.";
                    }
                }
                    //else
                    //{
                    //    TimeSheetObj.Update();
                    //}
            }
        }
コード例 #6
0
 public static TimeSheetGrid TimeSheetTaskGrid(CurrentUser logUser)
 {
     TimeSheetGrid result = new TimeSheetGrid(logUser, "timesheettask");
     TimeSheetTable TimeSheettaskTable = new TimeSheetTable();
     TimeSheettaskTable.tableId = "tblTimeSheetTask";
     TimeSheettaskTable.tableCSSClass = "dyntable";
     TimeSheettaskTable.Grid = result;
     TimeSheettaskTable.Columns.Add(new TimeSheetColumn() { fieldName = "UserName", headerName = " User Name", isHeader = true });
     TimeSheettaskTable.Columns.Add(new TimeSheetColumn() { fieldName = "ProjectName", headerName = "Project Name", isHeader = true });
     TimeSheettaskTable.Columns.Add(new TimeSheetColumn() { fieldName = "TaskName", headerName = "Task Name", isHeader = true });
     TimeSheettaskTable.Columns.Add(new TimeSheetColumn() { fieldName = "TaskDate", headerName = "Task Date", isHeader = true });
     TimeSheettaskTable.Columns.Add(new TimeSheetColumn() { fieldName = "Percentage", headerName = "Percentage", isHeader = true });
     TimeSheettaskTable.Columns.Add(new TimeSheetColumn() { fieldName = "Notes", headerName = "Notes", isHeader = true });
     TimeSheettaskTable.Columns.Add(new TimeSheetColumn() { fieldName = "CodeSnippet", headerName = "CodeSnippet", isHeader = true });
     result.gridTable = TimeSheettaskTable;
     return result;
 }
コード例 #7
0
 public static TimeSheetGrid taskGrid(CurrentUser logUser)
 {
     TimeSheetGrid result = new TimeSheetGrid(logUser, "Task");
     TimeSheetTable taskTable = new TimeSheetTable();
     taskTable.tableId = "tbltask";
     taskTable.tableCSSClass = "dyntable";
     taskTable.Grid = result;
     taskTable.Columns.Add(new TimeSheetColumn() { fieldName = "ProjectName", headerName = "Project Name", isHeader = true });
     taskTable.Columns.Add(new TimeSheetColumn() { fieldName = "TaskName", headerName = "Task Name", isHeader = true });
     taskTable.Columns.Add(new TimeSheetColumn() { fieldName = "BeginDate", headerName = "Begin Date", isHeader = true });
     taskTable.Columns.Add(new TimeSheetColumn() { fieldName = "EndDate", headerName = "End Date", isHeader = true });
     taskTable.Columns.Add(new TimeSheetColumn() { fieldName = "DevUserName", headerName = "Dev UserName", isHeader = true });
     taskTable.Columns.Add(new TimeSheetColumn() { fieldName = "QaUserName", headerName = "Qa UserName", isHeader = true });
     taskTable.Columns.Add(new TimeSheetColumn() { fieldName = "ApprovedUserName", headerName = "Approved UserName", isHeader = true });
     result.gridTable = taskTable;
     return result;
 }
コード例 #8
0
 public static TimeSheetGrid UserFieldsGrid(CurrentUser logUser)
 {
     TimeSheetGrid result = new TimeSheetGrid(logUser, "Users");
     TimeSheetTable UserFieldsTable = new TimeSheetTable();
     UserFieldsTable.tableId = "tblUserFields";
     UserFieldsTable.tableCSSClass = "dyntable";
     UserFieldsTable.Grid = result;
     UserFieldsTable.Columns.Add(new TimeSheetColumn() { fieldName = "UserName", headerName = " User Name", isHeader = true });
     UserFieldsTable.Columns.Add(new TimeSheetColumn() { fieldName = "FullName", headerName = "Full Name", isHeader = true });
     UserFieldsTable.Columns.Add(new TimeSheetColumn() { fieldName = "Email Address", headerName = "Email Address", isHeader = true });
     UserFieldsTable.Columns.Add(new TimeSheetColumn() { fieldName = "Address1", headerName = "Address1", isHeader = true });
     UserFieldsTable.Columns.Add(new TimeSheetColumn() { fieldName = "Address2", headerName = "Address2", isHeader = true });
     UserFieldsTable.Columns.Add(new TimeSheetColumn() { fieldName = "City", headerName = "City", isHeader = true });
     UserFieldsTable.Columns.Add(new TimeSheetColumn() { fieldName = "State", headerName = "State",isHeader = true });
     UserFieldsTable.Columns.Add(new TimeSheetColumn() { fieldName = "Role", headerName = "Role", isHeader = true });
     result.gridTable = UserFieldsTable;
     return result;
 }
コード例 #9
0
ファイル: login.aspx.cs プロジェクト: pravastech/TimeSheet
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                String sessionEnd = Request.QueryString["sessionEnd"];
                if (!String.IsNullOrEmpty(sessionEnd) && sessionEnd.Equals("1"))
                {
                    Session.Clear();
                    ltrSessionEndMsg.Text = Message("Your current session is ended. Please login again.", MsgType.Alert);
                }
                String logout = Request.QueryString["logout"];
                if (!String.IsNullOrEmpty(logout) && logout.Equals("1"))
                {
                    Session.RemoveAll();
                    ltrSessionEndMsg.Text = Message("You have been logged out.", MsgType.Information);
                }
            }
            else
            {
                String username = Request.Form["username"] ?? "";
                String password = Request.Form["password"] ?? "";

                CurrentUser User = new CurrentUser(username);
                if (User.IsLoginValid(password))
                {
                    HttpContext.Current.Session["UserInSession"] = username;
                    if (User.IsLoggedInWithTemp)
                    {
                        /* Should Change Password and fill in security questions */
                        Response.Redirect("User.aspx");
                    }
                    else
                    {
                        Response.Redirect("task.aspx");
                    }
                }
                else
                {
                    ltrSessionEndMsg.Text = Message("Invalid Username or Password.", MsgType.Error);
                }
            }
        }
コード例 #10
0
ファイル: Users.cs プロジェクト: pravastech/TimeSheet
 public Users(CurrentUser User)
     : base()
 {
     this.User = User;
 }
コード例 #11
0
ファイル: timesheettask.cs プロジェクト: pravastech/TimeSheet
 public timesheettask(CurrentUser User)
     : base()
 {
     this.User = User;
 }
コード例 #12
0
ファイル: Task.cs プロジェクト: pravastech/TimeSheet
 public Task(CurrentUser User)
     : base()
 {
     this.User = User;
 }
コード例 #13
0
ファイル: TimeSheetBase.cs プロジェクト: pravastech/TimeSheet
 public TimeSheetBase(CurrentUser User)
 {
     _user = User;
 }
コード例 #14
0
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            DateTime beginfromdate;
                DateTime.TryParse(Request.Form["beginFromDate"], out beginfromdate);

                if (beginfromdate == DateTime.MinValue)
            {
                beginfromdate = DateTime.Today.AddDays(-1);
            }

                String beginfrmdate = Request.Form["beginFromDate"] ?? "";
                if (string.IsNullOrEmpty(beginfrmdate))
                {
                    beginfrmdate = DateTime.Today.AddDays(-1).ToString("MM/dd/yyyy");
                }

                String endToDate = Request.Form["beginToDate"] ?? "";
                if (string.IsNullOrEmpty(endToDate))
                {
                    endToDate = DateTime.Today.AddDays(-1).ToString("MM/dd/yyyy");
                }

                String strUser = Request.Form["chooseuser"] ?? "";
                if (string.IsNullOrEmpty(endToDate))
                {
                    strUser = "******";
                }
                manager_report objManagerReport = new manager_report(beginfrmdate, endToDate,strUser);

                ltrReportData.Text = objManagerReport.ToTable();

            this.ltrPageScript.Text = JSUtil.encloseInJavascriptTag(@" $().ready(function(){
            $('#begindate').val('" + beginfrmdate + @"');
            $('#enddate').val('" + endToDate + @"');

               }); ");
            //CurrentUser user = new CurrentUser("TimeSheetAdmin");
            CurrentUser user = new CurrentUser(HttpContext.Current.Session["UserInSession"].ToString());
            var lstChooseUsers = new Users(user).Load("", "", "").Cast<Users>().ToList();
            this.ltrChooseUsers.Text = "<option value=\"\"></option>" +
            String.Join("", lstChooseUsers.Select(x => x.UserName).Distinct().Select(uname =>
            {
                return "<option value=\"" + HttpUtility.HtmlEncode(uname) + "\">" + HttpUtility.HtmlEncode(uname) + "</option>";
            }).ToArray());
        }
コード例 #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string submitKey = (Request.Form["submitKey"] ?? "").ToString();
             if (!string.IsNullOrEmpty(submitKey))
            {
            string allSubmitKeys = (Session["allSubmitKeys"] ?? "").ToString();
            if (!allSubmitKeys.Split(',').Contains(submitKey))
            {
                Session["allSubmitKeys"] = allSubmitKeys + "," + submitKey;
                CurrentUser user = new CurrentUser("TimeSheetAdmin");
                TimeSheetBO.Task taskObj = new TimeSheetBO.Task(user);
                Guid guidfield;
                Guid.TryParse(Request.Form["guidfield"], out guidfield);
                taskObj.LoadSingle(taskObj, " WHERE guidfield = @guidfield", "guidfield", guidfield);
                taskObj.ProjectName = Request.Form["SNO"];
                taskObj.TaskName = Request.Form["Project"];
                //taskObj.begindate = Request.Form["begindate"];
                String beginfromdate = Request.Form["beginFromDate"] ?? "";
                if (string.IsNullOrEmpty(beginfromdate))
                {
                    beginfromdate = DateTime.Today.AddDays(-1).ToString("MM/dd/yyyy");
                }
                //DateTime bdate;
                //DateTime.TryParse(Request.Form["beginFromDate"], out bdate);
                //taskObj.BeginDate = bdate;
                //string strbeginTime = Request.Form["beginFromDate"];
                //DateTime beginfromDate = new DateTime();
                ////beginDate=DateTime.ParseExact(strbeginTime,"MM/dd/yyyy",null);
                ////taskObj.begindate = beginDate;
                ////taskObj.begindate = DateTime.Now["begindate"];
                ////string strEndTime = Request.Form["enddate"];
                ////DateTime endDate = new DateTime();
                ////endDate = DateTime.ParseExact(strEndTime, "mm/dd/yyyy", null);
                //// taskObj.enddate = Request.Form["enddate"];
                DateTime edate;
                DateTime.TryParse(Request.Form["beginToDate"], out edate);
                taskObj.EndDate = edate;
                string strenddate = Request.Form["beginToDate"];
                DateTime enddate = new DateTime();
                taskObj.DevUserName = Request.Form["task"];
                taskObj.DevUserName = Request.Form["status"];
                //taskObj.QAUserName = Request.Form["qauserName"];
                //taskObj.ApprovedUserName = Request.Form["approveduserName"];
                //if (strbeginTime.Length == null)
                //{
                if (taskObj.Save())
                {

                    ltrMessage.Text = "Store saved successfully.";
                }
                else
                {
                    ltrMessage.Text = "Unable to save store information.";
                }

                //}
                //else
                //{
                //    taskObj.Update();
                //}
            }
                }
        }
コード例 #16
0
ファイル: task.aspx.cs プロジェクト: pravastech/TimeSheet
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            //CurrentUser user = new CurrentUser("TimeSheetAdmin");
            CurrentUser user = new CurrentUser(HttpContext.Current.Session["UserInSession"].ToString());
            var taskGrid = TimeSheetGridUtility.taskGrid(user);
            taskGrid.allowDelete = true;

            //var task = new task(user).load("", "", "").Cast<task>().ToList();
            var task = new TimeSheetBO.Task(user).Load("", "", "").Cast<TimeSheetBO.Task>().ToList();
            taskGrid.Rows.AddRange(task);

            ltrGridUI.Text = taskGrid.gridTable.ToHTML();
            ltrAddNew.Text = "<button type=\"button\" onclick=\"GridUtil.newRow();\">Add New</button>";
            ltrGridScript.Text = JSUtil.encloseInJavascriptTag("gridData = " + taskGrid.gridJS() + ";\ncolumnJS=[" + taskGrid.gridTable.columnJS() + "]");
            ltrHiddens.Text = taskGrid.gridTable.hiddenVars;

            var lstUsers = new Users(user).Load("", "", "").Cast<Users>().ToList();
            this.ltrdevUsers.Text = "<option value=\"\"></option>" +
            String.Join("", lstUsers.Select(x=>x.UserName).Distinct().Select(uname =>
            {
                return "<option value=\"" + HttpUtility.HtmlEncode(uname) + "\">" + HttpUtility.HtmlEncode(uname) + "</option>";
            }).ToArray());
            ltrqausers.Text = ltrdevUsers.Text;
            ltrapprovedusers.Text = ltrdevUsers.Text;
        }
コード例 #17
0
ファイル: LoginDetails.cs プロジェクト: pravastech/TimeSheet
 public LoginDetails(CurrentUser User)
     : base()
 {
     this.User = User;
 }
コード例 #18
0
ファイル: task.aspx.cs プロジェクト: pravastech/TimeSheet
        protected void Page_Load(object sender, EventArgs e)
        {
            #region old code for ref
            //            namespace Pos360
            //{
            //    public partial class tasksTest : System.Web.UI.Page
            //    {
            //        protected void Page_Load(object sender, EventArgs e)
            //        {
            //            string submitKey = (Request.Form["submitKey"] ?? "").ToString();
            //            if (!string.IsNullOrEmpty(submitKey))
            //            {
            //                string allSubmitKeys = (Session["allSubmitKeys"] ?? "").ToString();
            //                if (!allSubmitKeys.Split(',').Contains(submitKey))
            //                {
            //                    Session["allSubmitKeys"] = allSubmitKeys + "," + submitKey;
            //                    CurrentUser user = new CurrentUser("POSProcesor");
            //                    PosBO.tasks taskObj = new PosBO.tasks(user);
            //                    taskObj.LoadSingle(taskObj, " where rolename=@rolename", "rolename", Request.Form["rolename"] ?? "");
            //                    taskObj.roleName = Request.Form["rolename"];
            //                    taskObj.allowAdd = (Request.Form["allowadd"] ?? "").Equals("on");
            //                    taskObj.allowDelete = (Request.Form["allowdelete"] ?? "").Equals("on");
            //                    taskObj.allowEdit = (Request.Form["allowedit"] ?? "").Equals("on");
            //                    taskObj.allowView = (Request.Form["allowview"] ?? "").Equals("on");
            //                    if (taskObj.Save())
            //                    {
            //                        ltrMessage.Text = "Store saved successfully.";
            //                    }
            //                    else
            //                    {
            //                        ltrMessage.Text = "Unable to save store information.";
            //                    }
            //                }
            //            }

            //        }
            //        protected void Page_LoadComplete(object sender, EventArgs e)
            //        {
            //            CurrentUser user = new CurrentUser("POSProcesor");
            //            var tasksGrid = POSGridUtility.tasksGrid(user);

            //            var tasks = new tasks(user).Load("", "", "").Cast<tasks>().ToList();
            //            tasksGrid.Rows.AddRange(tasks);

            //            ltrGridUI.Text = tasksGrid.gridTable.ToHTML();
            //            ltrAddNew.Text = "<button type=\"button\" onclick=\"GridUtil.newRow();\">Add New</button>";
            //            ltrGridScript.Text = JSUtil.encloseInJavascriptTag("gridData = " + tasksGrid.gridJS() + ";\ncolumnJS=[" + tasksGrid.gridTable.columnJS() + "]");
            //            ltrHiddens.Text = tasksGrid.gridTable.hiddenVars;

            //        }
            //    }
            //}
            #endregion
            string submitKey = (Request.Form["submitKey"] ?? "").ToString();
            if (!string.IsNullOrEmpty(submitKey))
            {
                string allSubmitKeys = (Session["allSubmitKeys"] ?? "").ToString();
                if (!allSubmitKeys.Split(',').Contains(submitKey))
                {
                    Session["allSubmitKeys"] = allSubmitKeys + "," + submitKey;
                    CurrentUser user = new CurrentUser("TimeSheetAdmin");
                    TimeSheetBO.Task taskObj = new TimeSheetBO.Task(user);
                    Guid guidfield;
                    Guid.TryParse(Request.Form["guidfield"], out guidfield);
                    string req = Request.Form["guidfield"];
                    if (!string.IsNullOrEmpty(req))
                    {
                        taskObj.LoadSingle(taskObj, " WHERE guidfield = @guidfield", "guidfield", guidfield);
                    }
                   // taskObj.LoadSingle(taskObj, " WHERE guidfield = @guidfield", "guidfield", guidfield);
                    taskObj.ProjectName = Request.Form["projectname"];
                    taskObj.TaskName = Request.Form["taskname"];
                   // taskObj.begindate = Request.Form["begindate"];
                    DateTime bdate;
                    DateTime.TryParse(Request.Form["begindate"], out bdate);
                    taskObj.BeginDate = bdate;
                    string strbeginTime = Request.Form["begindate"];
                    DateTime beginDate =  new DateTime();
                    //beginDate=DateTime.ParseExact(strbeginTime,"MM/dd/yyyy",null);
                    //taskObj.begindate = beginDate;
                   //taskObj.begindate = DateTime.Now["begindate"];
                    //string strEndTime = Request.Form["enddate"];
                    //DateTime endDate = new DateTime();
                    //endDate = DateTime.ParseExact(strEndTime, "mm/dd/yyyy", null);
                   // taskObj.enddate = Request.Form["enddate"];
                    DateTime edate;
                    DateTime.TryParse(Request.Form["enddate"], out edate);
                    taskObj.EndDate = edate;
                    string strenddate = Request.Form["enddate"];
                    DateTime enddate = new DateTime();
                    taskObj.DevUserName = Request.Form["devuserName"];
                    taskObj.QAUserName = Request.Form["qauserName"];
                    taskObj.ApprovedUserName = Request.Form["approveduserName"];
                    //if (strbeginTime.Length == null)
                    //{
                        if (taskObj.Save())
                        {

                            ltrMessage.Text = "Store saved successfully.";
                        }
                        else
                        {
                            ltrMessage.Text = "Unable to save store information.";
                        }

                    //}
                    //else
                    //{
                    //    taskObj.Update();
                    //}
                }
            }
        }