public IList <Assignment> Assign(DateTime?begin, DateTime?endTime, StaffId staffId, int daysSpend) { var assignments = new List <Assignment>(); foreach (var cost in hrCosts) { } }
private void resetFormToolStripMenuItem_Click(object sender, EventArgs e) { StaffId.Clear(); FullName.Clear(); Gender.Clear(); Subject.Clear(); StaffId.Focus(); }
/// <summary> /// Finds the next day with clinic hours for the current department. Searches 30 days into the future /// and then throws an InvalidOperationException. /// </summary> /// <param name="context"></param> protected override void DoWork(CodeActivityContext context) { var scheduleData = ScheduleData.Get(context); var pairs = scheduleData.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries); foreach (var pair in pairs) { var tuple = pair.Split(new[] { '=' }, StringSplitOptions.RemoveEmptyEntries); if (tuple.Length != 2) { continue; } var name = tuple[0].Trim().ToLower(); var value = tuple[1].Trim(); switch (name) { case "pat_id1": PatId1.Set(context, Int32.Parse(value)); break; case "appt_dttm": AppDtTm.Set(context, DateTime.Parse(value)); break; case "activity": Activity.Set(context, value); break; case "staff_id": StaffId.Set(context, Int32.Parse(value)); break; case "private": // TODO: should we call the IsAppointmentPrivate logic from the Schedule BOM entity? Private.Set(context, Int16.Parse(value) != 0); break; case "create_id": CreateId.Set(context, Int32.Parse(value)); break; case "create_dttm": CreateDtTm.Set(context, DateTime.Parse(value)); break; } } }
Int32 DisplayFilterStaff(string StaffLastNameFilter) { Int32 StaffId; //string last name string StaffLastName; clsStaffCollection StaffBook = new clsStaffCollection(); StaffBook.ReportByStaffLastName(StaffLastNameFilter); Int32 RecordCount; Int32 Index = 0; RecordCount = StaffBook.Count; lstStaff.Items.Clear(); while (Index < RecordCount) { StaffId = StaffBook.StaffList[Index].StaffId; StaffLastName = StaffBook.StaffList[Index].StaffLastName; ListItem NewEntry = new ListItem(StaffLastName + "", StaffId.ToString()); lstStaff.Items.Add(NewEntry); Index++; } return(RecordCount); }
public LeisureDegree(StaffId staffid, decimal degree) { this.StaffId = staffid; this.Degree = degree; }
protected void btnSave_Click(object sender, EventArgs e) { DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.Staff, "btnSave_Click", "Submit btnSave_Click called", DayCarePL.Common.GUID_DEFAULT); try { DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.Role, "btnSave_Click", "Debug btnSave_Click ", DayCarePL.Common.GUID_DEFAULT); DayCareBAL.StaffService proxyStaffService = new DayCareBAL.StaffService(); DayCarePL.StaffProperties objStaff = new DayCarePL.StaffProperties(); Guid StaffId; txtPassword.Attributes.Add("value", txtPassword.Text); txtCode.Attributes.Add("value", txtCode.Text); if (fupImage.HasFile) { string Extention = Path.GetExtension(fupImage.FileName).ToLower(); string[] Ext = { ".jpeg", ".jpg", ".png" }; if (Ext.ToList().FindAll(et => et.Equals(Extention)).Count == 0) { MasterAjaxManager = this.Page.Master.FindControl("RadAjaxManager1") as Telerik.Web.UI.RadAjaxManager; MasterAjaxManager.ResponseScripts.Add(string.Format("ShowMessage('{0}','{1}')", "Please select .JPEG,.PNG file!", "false")); return; } } if (ViewState["SelectedStaffId"] != null) { objStaff.Id = new Guid(ViewState["SelectedStaffId"].ToString()); } else { if (Session["StaffId"] != null) { objStaff.CreatedById = new Guid(Session["StaffId"].ToString()); } } Guid SchoolId = new Guid(); if (Session["StaffId"] != null) { objStaff.LastModifiedById = new Guid(Session["StaffId"].ToString()); } if (!string.IsNullOrEmpty(txtUserName.Text.Trim())) { if (Session["SchoolId"] != null) { SchoolId = new Guid(Session["SchoolId"].ToString()); objStaff.SchoolId = SchoolId; objStaff.ScoolYearId = CurrentSchoolYearId; } bool result = proxyStaffService.CheckDuplicateUserName(txtUserName.Text.Trim(), objStaff.Id, SchoolId); if (result) { MasterAjaxManager = this.Page.Master.FindControl("RadAjaxManager1") as Telerik.Web.UI.RadAjaxManager; MasterAjaxManager.ResponseScripts.Add(string.Format("ShowMessage('{0}','{1}')", "User Name Already Exist", "false")); return; } } if (Session["SchoolId"] != null) { SchoolId = new Guid(Session["SchoolId"].ToString()); objStaff.SchoolId = SchoolId; objStaff.ScoolYearId = CurrentSchoolYearId; } bool IsCodeRequire = proxyStaffService.CheckCodeRequire(objStaff.SchoolId); if (IsCodeRequire) { if (string.IsNullOrEmpty(txtCode.Text.Trim())) { MasterAjaxManager = this.Page.Master.FindControl("RadAjaxManager1") as Telerik.Web.UI.RadAjaxManager; MasterAjaxManager.ResponseScripts.Add(string.Format("ShowMessage('{0}','{1}')", "Please enter Passcode", "false")); txtCode.Focus(); return; } } //bool result = proxyStaffService.CheckDuplicateCode(txtCode.Text.Trim(), objStaff.Id, SchoolId); //if (result) //{ // MasterAjaxManager = this.Page.Master.FindControl("RadAjaxManager1") as Telerik.Web.UI.RadAjaxManager; // MasterAjaxManager.ResponseScripts.Add(string.Format("ShowMessage('{0}','{1}')", "Code Already Exist", "false")); // return; //} objStaff.UserGroupId = new Guid(ddlUserGroup.SelectedValue); objStaff.StaffCategoryId = new Guid(ddlStaffCategory.SelectedValue); objStaff.FirstName = txtFirstName.Text.Trim(); objStaff.LastName = txtLastName.Text.Trim(); objStaff.Address1 = txtAddress1.Text.Trim(); objStaff.Address2 = txtAddress2.Text.Trim(); objStaff.City = txtCity.Text.Trim(); objStaff.Zip = txtZip.Text.Trim(); objStaff.CountryId = new Guid(ddlCountry.SelectedValue); objStaff.StateId = new Guid(ddlState.SelectedValue); objStaff.MainPhone = txtMainPhone.Text.Trim(); objStaff.SecondaryPhone = txtSecondaryPhone.Text.Trim(); objStaff.Email = txtEmail.Text.Trim(); objStaff.UserName = txtUserName.Text.Trim(); objStaff.Password = txtPassword.Text.Trim(); objStaff.Code = txtCode.Text.Trim(); //if (rdMale.Checked == true) //{ // objStaff.Gender = true; //} //else //{ // objStaff.Gender = false; //} if (ddlGender.SelectedValue == "true") { objStaff.Gender = true; } else { objStaff.Gender = false; } objStaff.SecurityQuestion = txtSecurityQuestion.Text.Trim(); objStaff.SecurityAnswer = txtSecurityAnswer.Text.Trim(); if (fupImage.HasFile) { objStaff.Photo = fupImage.FileName; } else { objStaff.Photo = lblImage.Text; } if (rdActive.Checked == true) { objStaff.Active = true; } else { objStaff.Active = false; } objStaff.Comments = txtComment.Text.Trim(); objStaff.Message = txtMessage.Text; //objStaff.IsPrimary = chkIsPrimary.Checked; StaffId = proxyStaffService.Save(objStaff); if (!StaffId.ToString().Equals(DayCarePL.Common.GUID_DEFAULT)) { if (fupImage.HasFile) { #region "resize image" // Create a bitmap of the content of the fileUpload control in memory Bitmap originalBMP = new Bitmap(fupImage.FileContent); // Calculate the new image dimensions double origWidth = originalBMP.Width; double origHeight = originalBMP.Height; double sngRatio = origWidth / origHeight; int newWidth = 200; int newHeight = (int)(newWidth / sngRatio); //int newHeight =0; //if (sngRatio > 0) // newHeight = newWidth / sngRatio; //else // newHeight = 200; // Create a new bitmap which will hold the previous resized bitmap Bitmap newBMP = new Bitmap(originalBMP, newWidth, newHeight); // Create a graphic based on the new bitmap Graphics oGraphics = Graphics.FromImage(newBMP); // Set the properties for the new graphic file oGraphics.SmoothingMode = SmoothingMode.AntiAlias; oGraphics.InterpolationMode = InterpolationMode.HighQualityBicubic; // Draw the new graphic based on the resized bitmap oGraphics.DrawImage(originalBMP, 0, 0, newWidth, newHeight); // Save the new graphic file to the server newBMP.Save(Server.MapPath("~/StaffImages/" + StaffId + Path.GetExtension(fupImage.FileName))); // Once finished with the bitmap objects, we deallocate them. originalBMP.Dispose(); newBMP.Dispose(); oGraphics.Dispose(); #endregion //fupImage.SaveAs(Server.MapPath("~/StaffImages/" + StaffId + Path.GetExtension(fupImage.FileName))); } //MasterAjaxManager = this.Page.Master.FindControl("RadAjaxManager1") as Telerik.Web.UI.RadAjaxManager; //MasterAjaxManager.ResponseScripts.Add(string.Format("ShowMessage('{0}','{1}')", "Saved Successfully", "false")); Response.Redirect("StaffList.aspx", false); } else { MasterAjaxManager = this.Page.Master.FindControl("RadAjaxManager1") as Telerik.Web.UI.RadAjaxManager; MasterAjaxManager.ResponseScripts.Add(string.Format("ShowMessage('{0}','{1}')", "Internal Error,Please try again.", "false")); return; } } catch (Exception ex) { DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.Staff, "btnSave_Click", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT); MasterAjaxManager = this.Page.Master.FindControl("RadAjaxManager1") as Telerik.Web.UI.RadAjaxManager; MasterAjaxManager.ResponseScripts.Add(string.Format("ShowMessage('{0}','{1}')", "Internal Error,Please try again", "false")); return; } }
private void StaffList_Load(object sender, EventArgs e) { StaffId.Focus(); LoadDataIntoDataGridView(); }