コード例 #1
0
    protected void SearchData()
    {
        //string query_company = GetCompanyScope();
        Staff _operator = new Staff("View_DeviceConfig");
        string conditionName = ddlst_SearchType.SelectedValue;
        string condition = "";
        //若查詢日期則把模糊查詢like改為=
        if (conditionName == "ContractStartDate" || conditionName == "ContractEndDate")
        {
            condition = (txt_Query_Reason.Text.Trim().Length > 0 ? " " + conditionName + " = '" + txt_Query_Reason.Text.Trim() + "' " : "");
        }
        else
        {
            condition = (txt_Query_Reason.Text.Trim().Length > 0 ? " " + conditionName + " like '%" + txt_Query_Reason.Text.Trim() + "%' " : "");
        }
        DataSet ds = _operator.Select(condition, "", "View_DeviceConfig");
        Session["DS_MIS"] = ds;
        gv.DataSource = ds;
        gv.DataBind();
        if (ds.Tables[0].Rows.Count == 0)
        {
            ShowMsg2(UpdatePanel1, "查詢無資料");
        }
        //for (int i = 0; i < gv.Rows.Count; i++)
        //{
        //    if (gv.Rows[i].Cells[10].Text.Trim().Equals("True"))
        //        gv.Rows[i].Cells[10].Text = "男";
        //    else
        //        gv.Rows[i].Cells[10].Text = "女";

        //}
    }
コード例 #2
0
		/// <summary>
		/// Obtains a set of interpretation steps that are candidates for linked reporting to the specified interpretation step.
		/// </summary>
		/// <param name="step"></param>
		/// <param name="author"></param>
		/// <returns></returns>
		public IList<ProtocolAssignmentStep> GetLinkedProtocolCandidates(ProtocolAssignmentStep step, Staff author)
		{
			var q = this.GetNamedHqlQuery("linkedProtocolCandidates");
			q.SetParameter(0, step);
			q.SetParameter(1, author);
			return q.List<ProtocolAssignmentStep>();
		}
コード例 #3
0
ファイル: Roles.aspx.cs プロジェクト: caikelun/PermissionBase
    private void AddSubNodes(Microsoft.Web.UI.WebControls.TreeNode currentNode, RoleType currentRoleType, Staff s)
    {
        //增加子角色分类
        foreach (RoleType rt in currentRoleType.SubRoleTypes)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type = "roletype";
            node.Text = rt.Name;
            node.PKId = rt.Id;

            AddSubNodes(node, rt, s);

            node.Expanded = true;
        }

        //增加角色
        foreach (Role r in currentRoleType.Roles)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type = "role";
            node.Text = r.Name;
            node.PKId = r.Id;
            node.CheckBox = true;
            node.Checked = s.Roles.Contains(r);
        }
    }
コード例 #4
0
        public ActionResult AddStaff(Staff t)
        {
            User search = db.Users.Where(x => x.EMail == t.EMail).FirstOrDefault();

            if (ModelState.IsValid && search == null)
            {
                t.HireDate = DateTime.Now;
                db.Staffs.Add(t);
                db.SaveChanges();

                User u = new User();
                u.EMail = t.EMail;
                u.FirstName = t.FirstName;
                u.LastName = t.LastName;
                u.Password = t.Password;
                u.Role = "Staff";

                db.Users.Add(u);
                db.SaveChanges();
                TempData["Success"] = u.FirstName + " " + u.LastName + " added successfully.";
                return RedirectToAction("ManageStaff", "Manager");

            }
            if (search != null)
                TempData["Error"] = search.EMail + " is already registered to the system.";
            return View();
        }
コード例 #5
0
    protected void SearchData()
    {
        String dat = txt_contractStartDate.Text;
        //String tim = txt_happen_Time.Text;

        Staff _operator = new Staff("Company");
        string condition = " WHERE 1=1";
        if (txt_Query_Reason.Text != "") 
        {
            condition += " AND MaterialName  like '%" + txt_Query_Reason.Text.Trim() + "%' ";
        }
        if (dat != "" ) 
        {
            condition += " AND (RelnventoryDate BETWEEN '" + dat + " 00:00:00' AND '" + dat + " 23:59:59')";
        }
        //condition += query_company;
        DataSet ds = _operator.SelectSQL("SELECT *  FROM [MROS].[dbo].[ICS_ReInventory] " + condition + " ORDER BY  [RelnventoryDate] DESC ");
        Session["DS_INT"] = ds;
        if (ds.Tables[0].Rows.Count == 0)
        {
            ShowMsg2(UpdatePanel1, "查詢無資料");
        }
       
            gv.DataSource = ds;
            gv.DataBind();
        
    }
コード例 #6
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string ID = e.CommandArgument.ToString().Trim();
        if (e.CommandName == "CustomDelete")
        {
            string userName;

            Staff objStaff = DataRepository.StaffProvider.GetById(int.Parse("0"+ID));
            userName = objStaff.UserName;

            TList<Appointment> listAppointmentDoctor = DataRepository.AppointmentProvider.GetByDoctorUsername(userName);
            TList<Appointment> listAppointmentNurse = DataRepository.AppointmentProvider.GetByNurseUsername(userName);
            TList<DoctorRoom> listDoctorRoom = DataRepository.DoctorRoomProvider.GetByDoctorUserName(userName);
            TList<DoctorFunc> listDoctorFunc = DataRepository.DoctorFuncProvider.GetByDoctorUserName(userName);
            TList<DoctorRoster> listDoctorRoster = DataRepository.DoctorRosterProvider.GetByDoctorUserName(userName);
            if (listAppointmentDoctor.Count > 0 || listAppointmentNurse.Count > 0 || listDoctorRoom.Count > 0 || listDoctorFunc.Count > 0 || listDoctorRoster.Count > 0)
            {
                Response.Write(@"<script language='javascript'>alert('Vui lòng xóa tất cả chi tiết.')</script>");

            }
            else
            {
                objStaff = new Staff();
                objStaff.Id = int.Parse(ID);
                DataRepository.StaffProvider.Delete(objStaff);
            }
            GridView1.DataBind();
        }
    }
コード例 #7
0
    private void AddSubNodes(Microsoft.Web.UI.WebControls.TreeNode currentNode, ModuleType currentModuleType, Staff staff)
    {
        //增加子模块分类
        foreach (ModuleType mt in currentModuleType.SubModuleTypes)
        {
            Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
            currentNode.Nodes.Add(node);
            node.Type = "moduletype";
            node.Text = mt.Name;
            AddSubNodes(node, mt, staff);
            node.Expanded = true;
        }

        //增加模块
        foreach (Module m in currentModuleType.Modules)
        {
            if (staff.IsInnerUser == 1 ||
                ((m.Disabled == 0) && staff.HasGrantPermission(ModuleRightSrv.GetModuleRight(m, "rights_browse"))))
            {
                Microsoft.Web.UI.WebControls.TreeNode node = new Microsoft.Web.UI.WebControls.TreeNode();
                currentNode.Nodes.Add(node);
                node.Type = "module";
                node.Text = m.Name;
                node.Target = "modulePanel";
                if(m.ModuleUrl != null && m.ModuleUrl.Length > 0)
                {
                    node.NavigateUrl = m.ModuleUrl;
                }
                else
                {
                    node.NavigateUrl = "Welcome.aspx";
                }
            }
        }
    }
コード例 #8
0
ファイル: Invoice.cs プロジェクト: nblaurenciana-md/Websites
 public Invoice(int invoice_id, int entity_id, int invoice_type_id, int booking_id, int payer_organisation_id, int payer_patient_id, int non_booking_invoice_organisation_id, string healthcare_claim_number, int reject_letter_id, string message,
                int staff_id, int site_id, DateTime invoice_date_added, decimal total, decimal gst, decimal receipts_total, decimal vouchers_total, decimal credit_notes_total, decimal refunds_total,
                bool is_paid, bool is_refund, bool is_batched, int reversed_by, DateTime reversed_date, DateTime last_date_emailed)
 {
     this.invoice_id              = invoice_id;
     this.entity_id               = entity_id;
     this.invoice_type            = new IDandDescr(invoice_type_id);
     this.booking                 = booking_id            == -1 ? null : new Booking(booking_id);
     this.payer_organisation      = payer_organisation_id ==  0 ? null : new Organisation(payer_organisation_id);
     this.payer_patient           = payer_patient_id      == -1 ? null : new Patient(payer_patient_id);
     this.non_booking_invoice_organisation = non_booking_invoice_organisation_id == -1 ? null : new Organisation(non_booking_invoice_organisation_id);
     this.healthcare_claim_number = healthcare_claim_number;
     this.reject_letter           = reject_letter_id      == -1 ? null : new Letter(reject_letter_id);
     this.message                 = message;
     this.staff                   = new Staff(staff_id);
     this.site                    = site_id               == -1 ? null : new Site(site_id);
     this.invoice_date_added      = invoice_date_added;
     this.total                   = total;
     this.gst                     = gst;
     this.receipts_total          = receipts_total;
     this.vouchers_total          = vouchers_total;
     this.credit_notes_total      = credit_notes_total;
     this.refunds_total           = refunds_total;
     this.is_paid                 = is_paid;
     this.is_refund               = is_refund;
     this.is_batched              = is_batched;
     this.reversed_by             = reversed_by == -1 ? null : new Staff(reversed_by);
     this.reversed_date           = reversed_date;
     this.last_date_emailed       = last_date_emailed;
 }
コード例 #9
0
ファイル: Patient.cs プロジェクト: nblaurenciana-md/Websites
 public Patient(int patient_id, int person_id, DateTime patient_date_added, bool is_clinic_patient, bool is_gp_patient,
     bool is_deleted, bool is_deceased,
     string flashing_text, int flashing_text_added_by, DateTime flashing_text_last_modified_date,
     string private_health_fund, string concession_card_number, DateTime concession_card_expiry_date,
     bool is_diabetic, bool is_member_diabetes_australia, DateTime diabetic_assessment_review_date, int ac_inv_offering_id, int ac_pat_offering_id,
     string login, string pwd,
     bool is_company, string abn,
     string next_of_kin_name, string next_of_kin_relation, string next_of_kin_contact_info)
 {
     this.patient_id                       = patient_id;
     this.person                           = new Person(person_id);
     this.patient_date_added               = patient_date_added;
     this.is_clinic_patient                = is_clinic_patient;
     this.is_gp_patient                    = is_gp_patient;
     this.is_deleted                       = is_deleted;
     this.is_deceased                      = is_deceased;
     this.flashing_text                    = flashing_text;
     this.flashing_text_added_by           = flashing_text_added_by == -1 ? null : new Staff(flashing_text_added_by);
     this.flashing_text_last_modified_date = flashing_text_last_modified_date;
     this.private_health_fund              = private_health_fund;
     this.concession_card_number           = concession_card_number;
     this.concession_card_expiry_date      = concession_card_expiry_date;
     this.is_diabetic                      = is_diabetic;
     this.is_member_diabetes_australia     = is_member_diabetes_australia;
     this.diabetic_assessment_review_date  = diabetic_assessment_review_date;
     this.ac_inv_offering                  = ac_inv_offering_id == -1 ? null : new Offering(ac_inv_offering_id);
     this.ac_pat_offering                  = ac_pat_offering_id == -1 ? null : new Offering(ac_pat_offering_id);
     this.login                            = login;
     this.pwd                              = pwd;
     this.is_company                       = is_company;
     this.abn                              = abn;
     this.next_of_kin_name                 = next_of_kin_name;
     this.next_of_kin_relation             = next_of_kin_relation;
     this.next_of_kin_contact_info         = next_of_kin_contact_info;
 }
コード例 #10
0
 public void UpdateMember(Staff staff)
 {
     for (int i = 0; i < this.lstBoxFrom.Items.Count; i++)
     {
         Staff staffNew = (this.lstBoxFrom.Items[i] as CustomMemberItem).DataContext as Staff;
         if (staffNew != null && staff.Uid == staffNew.Uid)
         {
             this.lstBoxFrom.Items.RemoveAt(i);
             CustomMemberItem item = new CustomMemberItem(CustomMemberType.Add);
             item.DataContext = staff;
             item.imgHead.Source = staff.HeaderImage;
             item.tbkAccount.Text = staff.Name;
             item.ItemAdd += new System.EventHandler(this.item_ItemAdd);
             this.lstBoxFrom.Items.Insert(i, item);
             break;
         }
     }
     for (int i = 0; i < this.lstBoxTo.Items.Count; i++)
     {
         Staff staffNew = (this.lstBoxTo.Items[i] as CustomMemberItem).DataContext as Staff;
         if (staffNew != null && staff.Uid == staffNew.Uid)
         {
             this.lstBoxTo.Items.RemoveAt(i);
             CustomMemberItem item = new CustomMemberItem(CustomMemberType.Add);
             item.DataContext = staff;
             item.imgHead.Source = staff.HeaderImage;
             item.tbkAccount.Text = staff.Name;
             item.ItemAdd += new System.EventHandler(this.item_ItemAdd);
             this.lstBoxTo.Items.Insert(i, item);
             break;
         }
     }
 }
コード例 #11
0
 public JsonResult Get(int page, int pageSize)
 {
     JsonResult result = new JsonResult();
     Staff bll = new Staff();
     var t = bll.FindByPage(pageSize, page);
     return Json(t, JsonRequestBehavior.AllowGet);
 }
コード例 #12
0
 public void AddStaff(Staff staff)
 {
     try
     {
         if (staff != null)
         {
             if (!this.staffNode.ContainsKey(staff.Uid))
             {
                 SelfDepartmentStaffNode node = new SelfDepartmentStaffNode(staff);
                 node.SessionService = this.sessionService;
                 node.DataService = this.dataService;
                 if (!this.staffNode.ContainsKey(staff.Uid))
                 {
                     this.staffNode.Add(staff.Uid, node);
                     base.Items.Add(node);
                     node.ContextMenu = this.GetContextMenu(node);
                     node.ContextMenuOpening += delegate(object s, ContextMenuEventArgs e)
                     {
                         if (DataModel.Instance.CustomeGroupName.Count > 0)
                         {
                             this.AddContextMenu(node, s);
                         }
                     };
                 }
             }
         }
     }
     catch (System.Exception ex)
     {
         this.logger.Error(ex.ToString());
     }
 }
コード例 #13
0
ファイル: App_Web_lm25o2vh.7.cs プロジェクト: hiway86/PRS_KAO
    protected void SearchData()
    {
        gv_stockOutitem.DataSource = null;
        gv_stockOutitem.DataBind();

        lbl_stockitem.Visible = false;
        //string query_company = GetCompanyScope();
        Staff _operator = new Staff("View_ICS_StockOut_Record");
        string conditionName = ddlst_SearchType.SelectedValue;
        StringBuilder  condition = new StringBuilder(txt_Query_Reason.Text.Trim().Length > 0 ? " " + conditionName + " like '%" + txt_Query_Reason.Text.Trim() + "%' AND " : "");
        //condition += query_company;
        if (txt_startDateTime.Text.Length > 0 )
        {
            condition.Append("  StockOutDate >= '" + txt_startDateTime.Text + "'  ");
        }
        if (txt_endDateTime.Text.Length > 0)
        {
            condition.Append("and StockOutDate <= '" + txt_endDateTime.Text + "' ");
        }
        DataSet ds = _operator.Select(condition.ToString(), "StockOutDate desc");
        //Session["DS_MIS"] = ds;
        gv.DataSource = ds;
        gv.DataBind();

        if (ds.Tables[0].Rows.Count == 0)
        {
            lbl_stockitem.Visible = true;
            lbl_stockitem.Text = "查詢無資料";
        }
    }
コード例 #14
0
 public void SaveInfo(Staff staff)
 {
     try
     {
         staff.Email = this.tbxEmail.Text;
         staff.Mobile = this.tbxMobile.Text;
         staff.MyDescription = this.tbxMyDescription.Text;
         staff.MyHome = this.tbxMyHome.Text;
         staff.Telephone = this.tbxPhone.Text;
         staff.School = this.tbxSchool.Text;
         staff.Job = this.cbxProfessional.Text;
         staff.Extension = this.tbxExtension.Text;
         string temp = this.cbxShowScope.Text;
         if (temp == "公开")
         {
             staff.ShowScope = 1;
         }
         else
         {
             if (temp == "保密")
             {
                 staff.ShowScope = 2;
             }
         }
     }
     catch (System.Exception e)
     {
         ServiceUtil.Instance.Logger.Error(e.ToString());
     }
 }
コード例 #15
0
		/// <summary>
		/// Obtains a set of interpretation steps that are candidates for linked reporting to the specified interpretation step.
		/// </summary>
		/// <param name="step"></param>
		/// <param name="interpreter"></param>
		/// <returns></returns>
		public IList<InterpretationStep> GetLinkedInterpretationCandidates(InterpretationStep step, Staff interpreter)
		{
			var q = this.GetNamedHqlQuery("linkedInterpretationCandidates");
			q.SetParameter(0, step);
			q.SetParameter(1, interpreter);
			return q.List<InterpretationStep>();
		}
コード例 #16
0
ファイル: Operations.cs プロジェクト: nhannd/Xian
			public void Execute(InterpretationStep step, Staff executingStaff, List<InterpretationStep> linkInterpretations, IWorkflow workflow)
			{
				// if not assigned, assign
				if (step.AssignedStaff == null)
				{
					step.Assign(executingStaff);
				}

				// put in-progress
				step.Start(executingStaff);

				// if a report has not yet been created for this step, create now
				if (step.ReportPart == null)
				{
					var report = new Report(step.Procedure);
					var reportPart = report.ActivePart;

					workflow.AddEntity(report);

					step.ReportPart = reportPart;
					step.ReportPart.Interpreter = executingStaff;
				}

				// attach linked interpretations to this report
				foreach (var interpretation in linkInterpretations)
				{
					interpretation.LinkTo(step);
				}
			}
コード例 #17
0
 public static Waypoint[] FindPracticeWaypoints(Staff staff)
 {
     Waypoint desk = null;
     List<Waypoint> availableWaypoints = new List<Waypoint>();
     foreach(Waypoint point in FindObjectsOfType(typeof(Waypoint)))
     {
         if(point.action == Waypoint.Action.practice && point.owner == staff)
         {
             desk = point;
         }
         if(point.action == Waypoint.Action.practiceAction)
         {
             availableWaypoints.Add (point);
         }
     }
     if(desk)
     {
         availableWaypoints.Add (desk);
     }
     availableWaypoints.Shuffle();
     Waypoint[] waypoints;
     waypoints = availableWaypoints.ToArray ();
     if(waypoints.Length >= 1)
     {
         waypoints[0] = desk;  // always puts the desk to the front of the array so the ReturnToDesk() function in the Staff class can actually work.
     }
     return waypoints;
 }
コード例 #18
0
ファイル: Storage.cs プロジェクト: carentsen/CSharp
 /// <summary>
 /// Save data as XML
 public static void SaveAsXml(Staff data)
 {
     FileStream file = new FileStream(fileName2, FileMode.Create);
     XmlSerializer formatter = new XmlSerializer(typeof(Staff));
     //BinaryFormatter formatter = new BinaryFormatter();
     formatter.Serialize(file, data);
     file.Close();
 }
コード例 #19
0
 public ActionResult Detail()
 {
     var id = Request.QueryString["id"].ToString();
     int sid = 0;
     var num = int.TryParse(id, out sid);
     ViewData["staffDetail"] = new Staff().Find(sid);
     return View();
 }
コード例 #20
0
 public SearchNodeStaff(Staff staff)
 {
     this.InitializeComponent();
     this.staff = staff;
     this.status = staff.Status;
     this.SetSizeHandler();
     this.UpdateInfo();
 }
コード例 #21
0
 public TreeNodeStaff(Staff staff)
 {
     this.InitializeComponent();
     this.staff = staff;
     this.status = staff.Status;
     this.UpdateInfo();
     this.AddEventListenerHandler();
 }
コード例 #22
0
 public Overpayment(int overpayment_id, int receipt_id, decimal total, DateTime overpayment_date_added, int staff_id)
 {
     this.overpayment_id = overpayment_id;
     this.receipt = new Receipt(receipt_id);
     this.total = total;
     this.overpayment_date_added = overpayment_date_added;
     this.staff = new Staff(staff_id);
 }
コード例 #23
0
 public SelfDepartmentStaffNode(Staff staff)
 {
     this.InitializeComponent();
     this.staff = staff;
     this.status = staff.Status;
     this.UpdateInfo();
     this.AddEventListenerHandler();
 }
コード例 #24
0
ファイル: frm_staff.cs プロジェクト: Nessievn/anglia-gym
 /**
  * @desc Default constructor for creating new staff from main menu.
  * This is for loading from main menu,
  * @params [none] No input parameter.
  * @return [none] No directly returned data.
  */
 public frm_staff()
 {
     clStaff = new Staff();
     InitializeComponent();
     button_equipmentbooking.Hide();
     DateTime today = DateTime.Today;
     txt_contract_start.Text = String.Format("{0:dd-MM-yyyy}", today);
 }
コード例 #25
0
 public ReferrerAdditionalEmail(int referrer_additional_email_id, int patient_id, string name, string email, int deleted_by, DateTime date_deleted)
 {
     this.referrer_additional_email_id = referrer_additional_email_id;
     this.patient_id                   = patient_id;
     this.name                         = name;
     this.email                        = email;
     this.deleted_by                   = deleted_by == -1 ? null : new Staff(deleted_by);
     this.date_deleted                 = date_deleted;
 }
コード例 #26
0
 static void Main()
 {
     Staff[] nojo = new Staff[100];
     nojo[0] = new Manager();
     nojo[1] = new Personnel();
     nojo[2] = new Account();
     nojo[3] = new Manager();
     nojo[4] = new Finance();
 }
コード例 #27
0
 public ActionResult Add()
 {
     var t = Request.QueryString["id"];
     if (t != null)
     {
         ViewData["stafflist"] = new Staff().Find(int.Parse(t.ToString()));
     }
     return View();
 }
コード例 #28
0
 public HealthCardEPCRemainingChangeHistory(int health_card_epc_remaining_change_history_id, int health_card_epc_remaining_id, int staff_id, DateTime date, int pre_num_services_remaining, int post_num_services_remaining)
 {
     this.health_card_epc_remaining_change_history_id = health_card_epc_remaining_change_history_id;
     this.health_card_epc_remaining = new HealthCardEPCRemaining(health_card_epc_remaining_id);
     this.staff = new Staff(staff_id);
     this.date = date;
     this.pre_num_services_remaining = pre_num_services_remaining;
     this.post_num_services_remaining = post_num_services_remaining;
 }
コード例 #29
0
    public void AssignStaff(Staff newStaff)
    {
        if (this.assignedStaff != null) return;

        newStaff.Assign(this);
        assignedStaff = newStaff;
        GetComponent<Collider>().enabled = false;
        newStaff.walker.MoveTo(staffPosition, false, OnStaffReady);
    }
コード例 #30
0
ファイル: frm_staff.cs プロジェクト: Nessievn/anglia-gym
 /**
  * @desc Default constructor for creating new staff from main menu.
  * This is for loading from main menu,
  * @params [none] No input parameter.
  * @return [none] No directly returned data.
  */
 public frm_staff()
 {
     clStaff = new Staff();
     InitializeComponent();
     this.Text = "Add New Gym Staff Form";
     button_equipmentbooking.Enabled = false;
     DateTime today = DateTime.Today;
     txt_contract_start.Text = String.Format("{0:dd-MM-yyyy}", today);
 }
コード例 #31
0
 public static void Remove(Staff obj)
 {
     StaffManager.Remove(obj);
 }
コード例 #32
0
ファイル: frmNhanVien.cs プロジェクト: phattaiv6/QLCFWF
        private void btnThemMoi_Click(object sender, EventArgs e)
        {
            try
            {
                HamTuTang();

                Staff  nv   = new Staff();
                string MHMK = frmDangNhap.MD5Hash(txtMK.Text);
                nv.TenNV          = txtTen.Text;
                nv.GioiTinh       = cmbGioiTinhNV.Text;
                nv.ChucVu         = txtChucVu.Text;
                nv.DiaChi         = txtDiaChiNV.Text;
                nv.SDT            = Convert.ToInt32(txtDienThoaiNV.Text);
                nv.MaNV           = txtIdNhanVien.Text;
                nv.TenDangNhap    = txtTK.Text;
                nv.MatKhau        = MHMK;
                nv.TrangThai      = "1";
                txtTrangThai.Text = "1";
                if (txtMK.Text == "")
                {
                    nv.MatKhau = "c4ca4238a0b923820dcc509a6f75849b";
                }



                if ((kiemtratontai() || kiemtratontaiDN()) == false)
                {
                    txtDienThoaiNV_EditValueChanged_1(sender, e);
                    txtTK_EditValueChanged(sender, e);



                    if (nhanVienBUS.Insert(nv))
                    {
                        XtraMessageBox.Show("Thêm thành công", "THÔNG BÁO  ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        txtTen.Text         = "";
                        txtChucVu.Text      = "";
                        txtDiaChiNV.Text    = "";
                        txtDienThoaiNV.Text = "";
                        txtTK.Text          = "";
                        txtMK.Text          = "";
                        btnThemMoi.Show();
                        lblphones.Text   = "";
                        labphonex.Text   = "";
                        labgioitinh.Text = "";
                        labmk.Text       = "";
                        labtk.Text       = "";
                        labchucvu.Text   = "";
                    }
                }
                else
                {
                    XtraMessageBox.Show("Thêm thất bại", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    btnThemMoi.Show();
                }

                frmNhanVien_Load(sender, e);
            }

            catch (Exception)
            {
                XtraMessageBox.Show("Thêm thất bại", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Information);


                btnThemMoi.Show();
            }
        }
コード例 #33
0
ファイル: Staff.cs プロジェクト: HelgeStenstrom/cs2018
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="other"></param>
 public Staff(Staff other)
 {
     this.name           = other.name;
     this.qualifications = other.qualifications;
 }
コード例 #34
0
 public void SetButtonCallback(Button button, Staff staff)
 {
     button.onClick.AddListener(() => staff.DisplayCallback());
 }
コード例 #35
0
 public NewFileListItem(System.IO.FileInfo fileInfo, PersonalChatTabControl staffChatTab, Staff staff)
 {
     try
     {
         this.InitializeComponent();
         if (fileInfo != null && staffChatTab != null && staff != null)
         {
             this.fileInfo            = fileInfo;
             this.staffChatTab        = staffChatTab;
             this.staff               = staff;
             this.item                = new FileItem(fileInfo);
             this.item.FromUid        = this.sessionService.Uid;
             this.item.ToJid          = this.staff.Jid;
             this.item.ToUid          = this.staff.Uid;
             this.item.FileService    = this.fileService;
             this.item.ProcessEvent   = new ProcessEvent(this.ProcessEventHandle);
             this.item.EndEvent       = new EndEvent(this.EndEventHandle);
             this.item.ErrorEvent     = new ErrorEvent(this.ErrorEventHandle);
             this.item.StopEvent      = new StopEvent(this.StopEventHandle);
             this.progressBar.Maximum = (double)fileInfo.Length;
             this.imgIcon.Source      = this.IconToBitmap(Icon.ExtractAssociatedIcon(fileInfo.FullName));
             this.IconBase64          = this.IconToBase64(Icon.ExtractAssociatedIcon(fileInfo.FullName));
             this.item.IconBase64     = this.IconBase64;
             this.tbkFilename.Text    = fileInfo.Name.Trim();
             this.fileName            = fileInfo.Name.Trim();
             this.tbkMsg.Text         = "正在发送文件";
             this.tbkSize.Text        = this.GetLength(fileInfo.Length);
             this.ShowCancelButton();
         }
     }
     catch (System.Exception e)
     {
         this.logger.Error(e.ToString());
     }
 }
コード例 #36
0
 void Start()
 {
     staff = gameObject.GetComponent <Staff>();
     StartCoroutine("OnThink");
 }
コード例 #37
0
 public void SetUp()
 {
     staff = new Staff();
 }
コード例 #38
0
 public PreviousElementPeekStrategy(Staff staff)
     : base(staff)
 {
 }
コード例 #39
0
 public NextElementPeekStrategy(Staff staff) : base(staff)
 {
 }
コード例 #40
0
 public WorkCentreRemove(StaffWorkCentreAllocation staffWorkCentreAllocation, Staff staff) : base(staffWorkCentreAllocation, staff)
 {
 }
コード例 #41
0
 public static string DisplayName(this Staff staff, bool upper = true)
 {
     return(StaffDisplayName(staff.LastName, staff.Gender, upper));
 }
コード例 #42
0
 private static void SetStaffCookie(Staff staff)
 {
     HttpContext.Current.Session["Username"]  = staff.Username;
     HttpContext.Current.Session["FirstName"] = staff.FirstName;
     HttpContext.Current.Session["LastName"]  = staff.LastName;
 }
コード例 #43
0
ファイル: PdaService.cs プロジェクト: qq283335746/Asset
        public ResResultModel SavePandianAsset(PdaPandianAssetFmModel model)
        {
            try
            {
                if (model == null)
                {
                    return(ResResult.Response(false, "请求参数集为空字符串", ""));
                }
                var userId = WebCommon.GetUserId();
                if (userId.Equals(Guid.Empty))
                {
                    return(ResResult.Response((int)ResCode.未登录, MC.Login_NotExist, ""));
                }
                var depmtId = new Staff().GetOrgId(userId);

                var pandianId = Guid.Empty;
                if (!Guid.TryParse(model.PandianId, out pandianId))
                {
                    return(ResResult.Response(false, "参数PandianId值为“" + model.PandianId + "”无效", ""));
                }

                var currTime = DateTime.Now;
                var gEmpty   = Guid.Empty;
                var minDate  = DateTime.Parse("1754-01-01");

                var pdaBll = new PandianAsset();
                var pBll   = new Product();
                var pdBll  = new Pandian();
                var effect = 0;

                foreach (var item in model.ItemList)
                {
                    var assetId = Guid.Empty;
                    if (!string.IsNullOrEmpty(item.AssetId))
                    {
                        Guid.TryParse(item.AssetId, out assetId);
                    }
                    var categoryId = Guid.Empty;
                    if (!string.IsNullOrEmpty(item.CategoryId))
                    {
                        Guid.TryParse(item.CategoryId, out categoryId);
                    }
                    var useDepmtId = Guid.Empty;
                    if (!string.IsNullOrEmpty(item.UseDepmtId))
                    {
                        Guid.TryParse(item.UseDepmtId, out useDepmtId);
                    }
                    var mgrDepmtId = Guid.Empty;
                    if (!string.IsNullOrEmpty(item.MgrDepmtId))
                    {
                        Guid.TryParse(item.MgrDepmtId, out mgrDepmtId);
                    }
                    var storeLocationId = Guid.Empty;
                    if (!string.IsNullOrEmpty(item.StoreLocationId))
                    {
                        Guid.TryParse(item.StoreLocationId, out storeLocationId);
                    }

                    ProductInfo productInfo = null;
                    if (item.Status == (int)EnumPandianAssetStatus.盘盈)
                    {
                        #region 盘盈

                        productInfo = new ProductInfo(GlobalConfig.SiteCode, userId, depmtId, Guid.NewGuid(), categoryId, item.Barcode, item.AssetName, item.Barcode, item.SpecModel, 1, 0, 0, item.Unit, 0, string.Empty, string.Empty, string.Empty, minDate, "1754-01-01", string.Empty, useDepmtId, item.UsePerson, mgrDepmtId, storeLocationId, string.Empty, item.Status, 0, true, currTime, currTime);
                        effect     += pBll.InsertByOutput(productInfo);
                        var pandianAssetInfo = new PandianAssetInfo(pandianId, productInfo.Id, productInfo.AppCode, productInfo.UserId, productInfo.DepmtId, gEmpty, gEmpty, gEmpty, string.Empty, 0, item.Remark, item.Status, currTime, currTime);
                        pdaBll.Insert(pandianAssetInfo);

                        #endregion
                    }
                    else
                    {
                        #region 非盘盈

                        productInfo = pBll.GetModel(assetId);
                        var pandianAssetInfo = pdaBll.GetModel(pandianId, assetId);
                        if (!useDepmtId.Equals(Guid.Empty) && !useDepmtId.Equals(productInfo.UseDepmtId))
                        {
                            pandianAssetInfo.LastUseDepmtId = useDepmtId;
                        }
                        if (!mgrDepmtId.Equals(Guid.Empty) && !mgrDepmtId.Equals(productInfo.MgrDepmtId))
                        {
                            pandianAssetInfo.LastMgrDepmtId = mgrDepmtId;
                        }
                        if (!storeLocationId.Equals(Guid.Empty) && !storeLocationId.Equals(productInfo.StoragePlaceId))
                        {
                            pandianAssetInfo.LastStoragePlaceId = storeLocationId;
                        }
                        if (!string.IsNullOrEmpty(item.UsePerson) && item.UsePerson != productInfo.UsePersonName)
                        {
                            pandianAssetInfo.LastUsePerson = item.UsePerson;
                        }
                        pandianAssetInfo.Status = item.Status;

                        effect += pdaBll.Update(pandianAssetInfo);

                        #endregion
                    }
                }

                if (effect < 1)
                {
                    return(ResResult.Response(false, "操作失败", ""));
                }

                return(ResResult.Response(true, "调用成功", ""));
            }
            catch (Exception ex)
            {
                return(ResResult.Response(false, ex.Message, ""));
            }
        }
コード例 #44
0
        private void SubmitLogin_OnClick(object sender, RoutedEventArgs e)
        {
            UserModel user = new UserModel();

            Dispatcher.Invoke(() =>
            {
                try
                {
                    if (user.Login(InputEmail.Text, InputPassword.Password))
                    {
                        switch (user.RoleId)
                        {
                        case 1:
                            //Admin
                            Admin admin = new Admin();

                            admin.Show();
                            //Close Login Window
                            Close();

                            break;

                        case 2:
                            //Secretary
                            Secretary secretary = new Secretary();

                            secretary.Show();
                            //Close Login Window
                            Close();

                            break;

                        case 3:
                            //Staff
                            Staff staff = new Staff();

                            staff.Show();
                            //Close Login Window
                            Close();

                            break;

                        case 4:
                            //Student
                            Student userStudent = new Student();

                            //Open Student Window
                            userStudent.Show();
                            Close();

                            break;
                        }
                    }
                    else
                    {
                        ErrorMsg.Text          = user.error;
                        InputPassword.Password = "";
                        InputEmail.Focus();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex + String.Empty);
                }
            });
        }
コード例 #45
0
 //修改
 public static int StaUp(Staff sta)
 {
     return(DAL.X.StaffSerivce.StaUp(sta));
 }
コード例 #46
0
 public EndOfTupletPeekStrategy(Staff staff) : base(staff)
 {
 }
コード例 #47
0
 //新增
 public static int Add(Staff sta)
 {
     return(DAL.X.StaffSerivce.Add(sta));
 }
コード例 #48
0
ファイル: UnitTest1.cs プロジェクト: lewisc0021/Lab11
        public void TestMethod3()
        {
            Staff result3 = new Staff("Sam", "55 South Blvd", "Wayne State", 50000);

            Assert.AreEqual("Staff[Person[name=Sam,address=55 South Blvd],school=Wayne State,pay=50000]", result3.ToString());
        }
コード例 #49
0
ファイル: StaffViewModel.cs プロジェクト: alihan21/FlightApp
 public StaffViewModel(Staff staff)
 {
     Name = staff.Name;
 }
コード例 #50
0
ファイル: Staff.cs プロジェクト: Snazzikiel/Uni-Work
 //methods
 public void addUser(Staff tmpStaff)
 {
     dictionaryStaff.Add(tmpStaff.id, tmpStaff);
 }
コード例 #51
0
 public BeginningOfMeasurePeekStrategy(Staff staff) : base(staff)
 {
 }
コード例 #52
0
 public int Update(Staff staff)
 {
     return(StaffRepository.Update(staff));
 }
コード例 #53
0
 public int Insert(Staff staff)
 {
     return(StaffRepository.Insert(staff));
 }
コード例 #54
0
ファイル: ScoreBarRenderer.cs プロジェクト: reec20/alphaTab
        public override void DoLayout()
        {
            _helpers = Staff.StaveGroup.Helpers.Helpers[Bar.Staff.Track.Index][Bar.Staff.Index][Bar.Index];

            var res           = Resources;
            var glyphOverflow = (res.TablatureFont.Size / 2) + (res.TablatureFont.Size * 0.2f);

            TopPadding    = glyphOverflow;
            BottomPadding = glyphOverflow;

            base.DoLayout();

            Height = (LineOffset * 4) + TopPadding + BottomPadding;
            if (Index == 0)
            {
                Staff.RegisterStaveTop(TopPadding);
                Staff.RegisterStaveBottom(Height - BottomPadding);
            }

            var top    = GetScoreY(0);
            var bottom = GetScoreY(8);

            for (int i = 0, j = _helpers.BeamHelpers.Count; i < j; i++)
            {
                var v = _helpers.BeamHelpers[i];
                for (int k = 0, l = v.Count; k < l; k++)
                {
                    var h = v[k];
                    //
                    // max note (highest) -> top overflow
                    //
                    var maxNoteY = GetScoreY(GetNoteLine(h.MaxNote));
                    if (h.Direction == BeamDirection.Up)
                    {
                        maxNoteY -= GetStemSize(h.MaxDuration);
                        maxNoteY -= h.FingeringCount * Resources.GraceFont.Size;
                        if (h.HasTuplet)
                        {
                            maxNoteY -= Resources.EffectFont.Size * 2;
                        }
                    }

                    if (h.HasTuplet)
                    {
                        maxNoteY -= Resources.EffectFont.Size * 1.5f;
                    }

                    if (maxNoteY < top)
                    {
                        RegisterOverflowTop(Math.Abs(maxNoteY));
                    }

                    //
                    // min note (lowest) -> bottom overflow
                    //t
                    var minNoteY = GetScoreY(GetNoteLine(h.MinNote));
                    if (h.Direction == BeamDirection.Down)
                    {
                        minNoteY += GetStemSize(h.MaxDuration);
                        minNoteY += h.FingeringCount * Resources.GraceFont.Size;
                    }

                    if (minNoteY > bottom)
                    {
                        RegisterOverflowBottom(Math.Abs(minNoteY) - bottom);
                    }
                }
            }
        }
コード例 #55
0
    protected void GrdStaff_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName.Equals("Insert"))
        {
            CustomValidator txtValidateDOB = (CustomValidator)GrdStaff.FooterRow.FindControl("txtValidateNewDOB");
            if (!txtValidateDOB.IsValid)
            {
                return;
            }

            DropDownList ddlTitle      = (DropDownList)GrdStaff.FooterRow.FindControl("ddlNewTitle");
            TextBox      txtFirstname  = (TextBox)GrdStaff.FooterRow.FindControl("txtNewFirstname");
            TextBox      txtMiddlename = (TextBox)GrdStaff.FooterRow.FindControl("txtNewMiddlename");
            TextBox      txtSurname    = (TextBox)GrdStaff.FooterRow.FindControl("txtNewSurname");
            DropDownList ddlGender     = (DropDownList)GrdStaff.FooterRow.FindControl("ddlNewGender");
            TextBox      txtDOB        = (TextBox)GrdStaff.FooterRow.FindControl("txtNewDOB");

            TextBox txtLogin = (TextBox)GrdStaff.FooterRow.FindControl("txtNewLogin");
            TextBox txtPwd   = (TextBox)GrdStaff.FooterRow.FindControl("txtNewPwd");


            //DropDownList ddlStaffPosition     = (DropDownList)GrdStaff.FooterRow.FindControl("ddlNewStaffPosition");
            DropDownList ddlField             = (DropDownList)GrdStaff.FooterRow.FindControl("ddlNewField");
            CheckBox     chkContractor        = (CheckBox)GrdStaff.FooterRow.FindControl("chkNewContractor");
            TextBox      txtTFN               = (TextBox)GrdStaff.FooterRow.FindControl("txtNewTFN");
            DropDownList ddlStatus            = (DropDownList)GrdStaff.FooterRow.FindControl("ddlStatus");
            DropDownList ddlCostCentre        = (DropDownList)GrdStaff.FooterRow.FindControl("ddlNewCostCentre");
            TextBox      txtProviderNumber    = (TextBox)GrdStaff.FooterRow.FindControl("txtNewProviderNumber");
            CheckBox     chkIsCommission      = (CheckBox)GrdStaff.FooterRow.FindControl("chkNewIsCommission");
            TextBox      txtCommissionPercent = (TextBox)GrdStaff.FooterRow.FindControl("txtNewCommissionPercent");

            CheckBox chkIsStakeholder = (CheckBox)GrdStaff.FooterRow.FindControl("chkNewIsStakeholder");
            CheckBox chkIsAdmin       = (CheckBox)GrdStaff.FooterRow.FindControl("chkNewIsAdmin");
            CheckBox chkIsMasterAdmin = (CheckBox)GrdStaff.FooterRow.FindControl("chkNewIsMasterAdmin");
            CheckBox chkIsPrincipal   = (CheckBox)GrdStaff.FooterRow.FindControl("chkNewIsPrincipal");
            CheckBox chkIsProvider    = (CheckBox)GrdStaff.FooterRow.FindControl("chkNewIsProvider");
            CheckBox chkSMSBKs        = (CheckBox)GrdStaff.FooterRow.FindControl("chkNewSMSBKs");
            CheckBox chkEmailBKs      = (CheckBox)GrdStaff.FooterRow.FindControl("chkNewEmailBKs");


            if (chkIsProvider.Checked && (StaffDB.GetCountOfProviders() >= Convert.ToInt32(SystemVariableDB.GetByDescr("MaxNbrProviders").Value)))
            {
                SetErrorMessage("You have reached your maximum allowable providers. Please uncheck their status as a provider to add them. Contact Mediclinic if you would like to upgrade your account.");
                return;
            }


            if (!Convert.ToBoolean(ConfigurationManager.AppSettings["UseConfigDB"]) && UserDatabaseMapperDB.UsernameExists(txtLogin.Text))
            {
                SetErrorMessage("Login name already in use by another user");
                return;
            }
            if (StaffDB.LoginExists(txtLogin.Text))
            {
                SetErrorMessage("Login name already in use by another user");
                return;
            }
            if (txtPwd.Text.Length < 6)
            {
                SetErrorMessage("Password must be at least 6 characters");
                return;
            }


            DateTime dob = GetDate(txtDOB.Text.Trim());

            int person_id    = -1;
            int mainDbUserID = -1;

            try
            {
                if (!!Convert.ToBoolean(ConfigurationManager.AppSettings["UseConfigDB"]))
                {
                    mainDbUserID = UserDatabaseMapperDB.Insert(txtLogin.Text, Session["DB"].ToString());
                }

                if (chkIsMasterAdmin.Checked)
                {
                    chkIsAdmin.Checked = true;
                }

                Staff loggedInStaff = StaffDB.GetByID(Convert.ToInt32(Session["StaffID"]));
                person_id = PersonDB.Insert(loggedInStaff.Person.PersonID, Convert.ToInt32(ddlTitle.SelectedValue), Utilities.FormatName(txtFirstname.Text), Utilities.FormatName(txtMiddlename.Text), Utilities.FormatName(txtSurname.Text), "", ddlGender.SelectedValue, dob);
                StaffDB.Insert(person_id, txtLogin.Text, txtPwd.Text, StaffPositionDB.GetByDescr("Unknown").StaffPositionID, Convert.ToInt32(ddlField.SelectedValue), Convert.ToInt32(ddlCostCentre.SelectedValue),
                               chkContractor.Checked, txtTFN.Text, txtProviderNumber.Text.ToUpper(),
                               ddlStatus.SelectedValue == "Inactive", chkIsCommission.Checked, Convert.ToDecimal(txtCommissionPercent.Text),
                               chkIsStakeholder.Checked, chkIsMasterAdmin.Checked, chkIsAdmin.Checked, chkIsPrincipal.Checked, chkIsProvider.Checked, false,
                               DateTime.Today, DateTime.MinValue, "", chkSMSBKs.Checked, chkEmailBKs.Checked);

                FillGrid();
            }
            catch (Exception)
            {
                // roll back - backwards of creation order
                PersonDB.Delete(person_id);
                if (!!Convert.ToBoolean(ConfigurationManager.AppSettings["UseConfigDB"]))
                {
                    UserDatabaseMapperDB.Delete(mainDbUserID);
                }
            }
        }
    }
コード例 #56
0
        public async Task <ExShop> GetShopInfo(int locationId)
        {
            var sw = new Stopwatch();

            sw.Start();

            using (var db = new Db())
            {
                Logging.Log.LogWarning("create db context " + sw.Elapsed);
                sw.Reset();
                sw.Start();

                var location = db.TblLocations
                               .Include(x => x.Store)
                               .Include(x => x.Store).ThenInclude(x => x.TblStoreCategories)
                               .Include(x => x.Store).ThenInclude(x => x.TblStoreCategories).ThenInclude(x => x.TblProductCategory)
                               .Include(x => x.Store).ThenInclude(x => x.TblStoreDelivery)
                               .Include(x => x.Store).ThenInclude(x => x.TblStoreDelivery).ThenInclude(x => x.TblDeliveryOption)
                               .Include(x => x.Store).ThenInclude(x => x.TblStorePayments)
                               .Include(x => x.Store).ThenInclude(x => x.TblStorePayments).ThenInclude(x => x.TblPaymentOption)
                               .Include(x => x.Store).ThenInclude(x => x.OpeningHours)
                               .Include(x => x.Store).ThenInclude(x => x.SpecialDays)
                               .Include(x => x.Store).ThenInclude(x => x.Absences)
                               .Include(x => x.TblLocationEmployee)
                               .Include(x => x.TblLocationEmployee).ThenInclude(x => x.TblEmployee)
                               .Include(x => x.TblLocationEmployee).ThenInclude(x => x.TblEmployee).ThenInclude(x => x.TblVirtualWorkTimes)
                               .AsNoTracking()
                               .FirstOrDefault(x => x.Id == locationId);

                if (location == null)
                {
                    return(null);
                }

                Logging.Log.LogWarning("linq " + sw.Elapsed);
                sw.Reset();
                sw.Start();

                var res = new ExShop
                {
                    Id           = location.Id,
                    Name         = location.Store.CompanyName,
                    Position     = new BissPosition(location.Latitude, location.Longitude),
                    MainCategory = location.Store.TblStoreCategories.FirstOrDefault(x => x.IsMainStoreCategory) != null
                                  ? new ExCategory
                    {
                        Id    = location.Store.TblStoreCategories.FirstOrDefault(x => x.IsMainStoreCategory).TblProductCategory.Id,
                        Name  = location.Store.TblStoreCategories.FirstOrDefault(x => x.IsMainStoreCategory).TblProductCategory.Description,
                        Glyph = location.Store.TblStoreCategories.FirstOrDefault(x => x.IsMainStoreCategory).TblProductCategory.Icon,
                    }
                                  : location.Store.TblStoreCategories?.FirstOrDefault() != null
                                      ? new ExCategory
                    {
                        Id    = location.Store.TblStoreCategories.FirstOrDefault().TblProductCategory.Id,
                        Name  = location.Store.TblStoreCategories.FirstOrDefault().TblProductCategory.Description,
                        Glyph = location.Store.TblStoreCategories.FirstOrDefault().TblProductCategory.Icon,
                    }
                                      : null,
                    Categories = location.Store.TblStoreCategories != null
                                  ? location.Store.TblStoreCategories.Select(x => new ExCategory
                    {
                        Id    = x.TblProductCategory.Id,
                        Name  = x.TblProductCategory.Description,
                        Glyph = x.TblProductCategory.Icon,
                    }).ToList()
                                  : new List <ExCategory>(),
                    DeliveryMethods = location.Store.TblStoreDelivery != null
                                  ? location.Store.TblStoreDelivery.Select(x => new ExDeliveryMethod
                    {
                        Id    = x.TblDeliveryOption.Id,
                        Name  = x.TblDeliveryOption.Description,
                        Glyph = x.TblDeliveryOption.Icon,
                    }).ToList()
                                  : new List <ExDeliveryMethod>(),
                    PaymentMethods = location.Store.TblStorePayments != null
                                  ? location.Store.TblStorePayments.Select(x => new ExPaymentMethod
                    {
                        Id    = x.TblPaymentOption.Id,
                        Name  = x.TblPaymentOption.Description,
                        Glyph = x.TblPaymentOption.Icon,
                    }).ToList()
                                  : new List <ExPaymentMethod>(),

                    PhoneNumber  = location.Telephonenumber,
                    WebLink      = location.Store.Website,
                    LocationName = location.Name,
                    Address      = location.Address,
                    PostCode     = location.PostCode,
                    City         = location.City,
                    FederalState = location.FederalState,
                    Country      = location.Country,
                    Employees    = location.TblLocationEmployee != null
                                  ? location.TblLocationEmployee.Select(x => Staff.GetExStaff(x.TblEmployee)).ToList()
                                  : new List <ExStaff>(),
                    Description = location.Store.Description,
                    ImageUrl    = Constants.ServiceClientEndPointWithApiPrefix + nameof(GetStoreImage) + "/" + location.StoreId,
                };

                Logging.Log.LogWarning("stammdaten " + sw.Elapsed);

                #region Öffnungszeiten

                var openingHours = new List <ExOpeningHour>();

                for (var i = 0; i < 7; i++)
                {
                    var checkDate = DateTime.UtcNow.Date.AddDays(i);

                    var opening = location.Store.OpeningHours.FirstOrDefault(x => x.Weekday == checkDate.DayOfWeek);

                    var specialDay = location.Store.SpecialDays.FirstOrDefault(x => x.Date == checkDate);

                    var abscence = location.Store.Absences.FirstOrDefault(x => x.Date == checkDate);

                    openingHours.Add(new ExOpeningHour
                    {
                        Day           = checkDate,
                        TimeFrom      = abscence != null || opening?.TimeFrom == null ? (DateTime?)null : DateTime.SpecifyKind(opening.TimeFrom.Value, DateTimeKind.Utc),
                        TimeTo        = abscence != null || opening?.TimeTo == null ? (DateTime?)null : DateTime.SpecifyKind(opening.TimeTo.Value, DateTimeKind.Utc),
                        IsAbscenceDay = abscence != null,
                        IsSpecialDay  = specialDay != null,
                    });
                }

                res.OpeningHours = openingHours;

                #endregion

                Logging.Log.LogWarning("+Öffnungszeiten " + sw.Elapsed);

                #region Mitarbeiterslots heute

                var slots = MeetingSlots.GetSlots(db, location.Id, DateTime.UtcNow);

                res.FreeSlots = slots.Where(x => x.Id < 0).ToList();

                #endregion

                Logging.Log.LogWarning("+Slots " + sw.Elapsed);

                #region Ist geöffnet

                if (openingHours.FirstOrDefault().IsAbscenceDay)
                {
                    res.IsOpen = false;
                }
                else if (openingHours.FirstOrDefault().IsSpecialDay)
                {
                    res.IsOpen = true;
                }
                else if (openingHours.FirstOrDefault().TimeFrom == null)
                {
                    res.IsOpen = false;
                }
                else
                {
                    var openeningHours = openingHours.FirstOrDefault();

                    var currentTime = new DateTime(1, 1, 2, DateTime.UtcNow.Hour, DateTime.UtcNow.Minute, DateTime.UtcNow.Second);

                    var timeFrom = new DateTime(1, 1, (openeningHours.TimeFrom?.Date < openeningHours.TimeTo?.Date ? 1 : 2), openeningHours?.TimeFrom?.Hour ?? 0, openeningHours?.TimeFrom?.Minute ?? 0, openeningHours?.TimeFrom?.Second ?? 0);
                    var timeTo   = new DateTime(1, 1, 2, openeningHours?.TimeTo?.Hour ?? 23, openeningHours?.TimeTo?.Minute ?? 59, openeningHours?.TimeTo?.Second ?? 59);

                    var shopIsOpenNow = openeningHours == null || (currentTime >= timeFrom && currentTime <= timeTo);

                    res.IsOpen = shopIsOpenNow;

                    // Shop ist generell offen - verfügbarkeit checken
                    if (res.IsOpen)
                    {
                        foreach (var locationEmployee in location.TblLocationEmployee)
                        {
                            var workTimeToday = locationEmployee.TblEmployee.TblVirtualWorkTimes.FirstOrDefault(x => x.Weekday == DateTime.UtcNow.Date.DayOfWeek);

                            if (workTimeToday == null)
                            {
                                continue;
                            }

                            var meetings = db.TblAppointments.AsNoTracking()
                                           .Where(x => x.EmployeeId == locationEmployee.Id && x.ValidTo >= currentTime && x.ValidFrom <= currentTime && !x.Canceled);

                            var meeting = meetings.FirstOrDefault();

                            if (meeting == null)
                            {
                                res.IsFree = true;
                                break;
                            }
                        }
                    }
                }

                #endregion

                Logging.Log.LogWarning("+isOpen " + sw.Elapsed);

                // TODO nexten Timeslot suchen und angeben ob frei oder besetzt
                res.NextSlot       = DateTime.SpecifyKind(res.FreeSlots.FirstOrDefault()?.Start ?? DateTime.UtcNow.AddYears(1), DateTimeKind.Utc);
                res.WhatsappNumber = res.FreeSlots.FirstOrDefault()?.Staff?.WhatsappContact ??
                                     location.TblLocationEmployee?.FirstOrDefault()?.TblEmployee?.TelephoneNumber;

                Logging.Log.LogWarning("Finished " + sw.Elapsed);
                sw.Stop();

                return(res);
            }
        }
コード例 #57
0
    protected void GrdStaff_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        Label        lblId         = (Label)GrdStaff.Rows[e.RowIndex].FindControl("lblId");
        DropDownList ddlTitle      = (DropDownList)GrdStaff.Rows[e.RowIndex].FindControl("ddlTitle");
        TextBox      txtFirstname  = (TextBox)GrdStaff.Rows[e.RowIndex].FindControl("txtFirstname");
        TextBox      txtMiddlename = (TextBox)GrdStaff.Rows[e.RowIndex].FindControl("txtMiddlename");
        TextBox      txtSurname    = (TextBox)GrdStaff.Rows[e.RowIndex].FindControl("txtSurname");
        DropDownList ddlGender     = (DropDownList)GrdStaff.Rows[e.RowIndex].FindControl("ddlGender");
        DropDownList ddlDOB_Day    = (DropDownList)GrdStaff.Rows[e.RowIndex].FindControl("ddlDOB_Day");
        DropDownList ddlDOB_Month  = (DropDownList)GrdStaff.Rows[e.RowIndex].FindControl("ddlDOB_Month");
        DropDownList ddlDOB_Year   = (DropDownList)GrdStaff.Rows[e.RowIndex].FindControl("ddlDOB_Year");

        TextBox txtLogin = (TextBox)GrdStaff.Rows[e.RowIndex].FindControl("txtLogin");
        TextBox txtPwd   = (TextBox)GrdStaff.Rows[e.RowIndex].FindControl("txtPwd");
        //DropDownList ddlStaffPosition     = (DropDownList)GrdStaff.Rows[e.RowIndex].FindControl("ddlStaffPosition");
        DropDownList ddlField             = (DropDownList)GrdStaff.Rows[e.RowIndex].FindControl("ddlField");
        CheckBox     chkContractor        = (CheckBox)GrdStaff.Rows[e.RowIndex].FindControl("chkContractor");
        TextBox      txtTFN               = (TextBox)GrdStaff.Rows[e.RowIndex].FindControl("txtTFN");
        DropDownList ddlStatus            = (DropDownList)GrdStaff.Rows[e.RowIndex].FindControl("ddlStatus");
        DropDownList ddlCostCentre        = (DropDownList)GrdStaff.Rows[e.RowIndex].FindControl("ddlCostCentre");
        TextBox      txtProviderNumber    = (TextBox)GrdStaff.Rows[e.RowIndex].FindControl("txtProviderNumber");
        CheckBox     chkIsCommission      = (CheckBox)GrdStaff.Rows[e.RowIndex].FindControl("chkIsCommission");
        TextBox      txtCommissionPercent = (TextBox)GrdStaff.Rows[e.RowIndex].FindControl("txtCommissionPercent");
        CheckBox     chkIsStakeholder     = (CheckBox)GrdStaff.Rows[e.RowIndex].FindControl("chkIsStakeholder");
        CheckBox     chkIsAdmin           = (CheckBox)GrdStaff.Rows[e.RowIndex].FindControl("chkIsAdmin");
        CheckBox     chkIsMasterAdmin     = (CheckBox)GrdStaff.Rows[e.RowIndex].FindControl("chkIsMasterAdmin");
        CheckBox     chkIsPrincipal       = (CheckBox)GrdStaff.Rows[e.RowIndex].FindControl("chkIsPrincipal");
        CheckBox     chkIsProvider        = (CheckBox)GrdStaff.Rows[e.RowIndex].FindControl("chkIsProvider");
        CheckBox     chkSMSBKs            = (CheckBox)GrdStaff.Rows[e.RowIndex].FindControl("chkSMSBKs");
        CheckBox     chkEmailBKs          = (CheckBox)GrdStaff.Rows[e.RowIndex].FindControl("chkEmailBKs");


        int staff_id  = Convert.ToInt32(lblId.Text);
        int person_id = GetPersonID(Convert.ToInt32(lblId.Text));

        if (person_id == -1) // happens when back button hit after update .. with option to update again ... but no selected row exists within page data
        {
            GrdStaff.EditIndex = -1;
            FillGrid();
            return;
        }


        Staff staff = StaffDB.GetByID(staff_id);

        if (!Convert.ToBoolean(ConfigurationManager.AppSettings["UseConfigDB"]) && staff.Login != txtLogin.Text && UserDatabaseMapperDB.UsernameExists(txtLogin.Text))
        {
            SetErrorMessage("Login name already in use by another user");
            return;
        }
        if (staff.Login != txtLogin.Text && StaffDB.LoginExists(txtLogin.Text, staff_id))
        {
            SetErrorMessage("Login name already in use by another user");
            return;
        }
        if (staff.Pwd != txtPwd.Text && txtPwd.Text.Length < 6)
        {
            SetErrorMessage(staff.Pwd.Length >= 6 ? "Password must be at least 6 characters" : "New passwords must be at least 6 characters");
            return;
        }

        DataTable dt = Session["staffinfo_data"] as DataTable;

        DataRow[] foundRows = dt.Select("person_id=" + person_id.ToString());
        DataRow   row       = foundRows[0]; // Convert.ToInt32(row["person_id"])



        if (!Convert.ToBoolean(row["is_provider"]) && chkIsProvider.Checked && (StaffDB.GetCountOfProviders() >= Convert.ToInt32(SystemVariableDB.GetByDescr("MaxNbrProviders").Value)))
        {
            SetErrorMessage("You have reached your maximum allowable providers. Please uncheck their status as a provider to update them or hit cancel. Contact Mediclinic if you would like to upgrade your account.");
            return;
        }


        if (chkIsProvider.Checked)
        {
            System.Data.DataTable tbl = DBBase.GetGenericDataTable_WithWhereOrderClause(null, "Field", "has_offerings=1 AND field_id <> 0", "", "field_id", "descr");

            bool         roleSetAsProvider = false;
            IDandDescr[] fields            = new IDandDescr[tbl.Rows.Count];
            for (int i = 0; i < tbl.Rows.Count; i++)
            {
                fields[i] = new IDandDescr(Convert.ToInt32(tbl.Rows[i]["field_id"]), tbl.Rows[i]["descr"].ToString());
                if (Convert.ToInt32(ddlField.SelectedValue) == Convert.ToInt32(tbl.Rows[i]["field_id"]))
                {
                    roleSetAsProvider = true;
                }
            }

            if (!roleSetAsProvider)
            {
                if (fields.Length == 1)
                {
                    SetErrorMessage("When setting a staff member as a provider, you need to set their Role as '" + fields[0].Descr + "'.");
                    return;
                }
                else if (fields.Length == 2)
                {
                    SetErrorMessage("When setting a staff member as a provider, you need to set their Role as '" + fields[0].Descr + "' or '" + fields[1].Descr + "'.");
                    return;
                }
                else
                {
                    string providerFields = string.Empty;
                    for (int i = 0; i < fields.Length; i++)
                    {
                        providerFields += (providerFields.Length == 0 ? "" : ", ") + (fields.Length >= 2 && i == (fields.Length - 2) ? "or " : "") + fields[i].Descr;
                    }

                    SetErrorMessage("When setting a staff member as a provider, you need to set their Role as one of the following: " + providerFields);
                    return;
                }
            }
        }



        if (chkIsMasterAdmin.Checked)
        {
            chkIsAdmin.Checked = true;
        }

        PersonDB.Update(person_id, Convert.ToInt32(ddlTitle.SelectedValue), Utilities.FormatName(txtFirstname.Text), Utilities.FormatName(txtMiddlename.Text), Utilities.FormatName(txtSurname.Text), row["nickname"].ToString(), ddlGender.SelectedValue, GetDate(ddlDOB_Day.SelectedValue, ddlDOB_Month.SelectedValue, ddlDOB_Year.SelectedValue), DateTime.Now);
        StaffDB.Update(staff_id, person_id, txtLogin.Text, txtPwd.Text, Convert.ToInt32(row["staff_position_id"]), Convert.ToInt32(ddlField.SelectedValue), Convert.ToInt32(ddlCostCentre.SelectedValue),
                       chkContractor.Checked, txtTFN.Text, txtProviderNumber.Text.ToUpper(),
                       ddlStatus.SelectedValue == "Inactive", chkIsCommission.Checked, Convert.ToDecimal(txtCommissionPercent.Text),
                       chkIsStakeholder.Checked, chkIsMasterAdmin.Checked, chkIsAdmin.Checked, chkIsPrincipal.Checked, chkIsProvider.Checked, staff.IsExternal,
                       row["start_date"] == DBNull.Value ? DateTime.MinValue : (DateTime)row["start_date"], row["end_date"] == DBNull.Value ? DateTime.MinValue : (DateTime)row["end_date"], row["comment"].ToString(), chkSMSBKs.Checked, chkEmailBKs.Checked);

        if (!Convert.ToBoolean(ConfigurationManager.AppSettings["UseConfigDB"]) && staff.Login != txtLogin.Text)
        {
            UserDatabaseMapper curDBMapper = UserDatabaseMapperDB.GetByLogin(staff.Login, Session["DB"].ToString());
            if (curDBMapper == null)
            {
                UserDatabaseMapperDB.Insert(txtLogin.Text, Session["DB"].ToString());
            }
            else
            {
                UserDatabaseMapperDB.Update(curDBMapper.ID, txtLogin.Text, Session["DB"].ToString());
            }
        }


        GrdStaff.EditIndex = -1;
        FillGrid();
    }
コード例 #58
0
 public NewFileListItem(string fileName, string id, long size, PersonalChatTabControl staffChatTab, Staff staff, string iconBase64)
 {
     if (staffChatTab != null && staff != null)
     {
         this.InitializeComponent();
         this.staffChatTab        = staffChatTab;
         this.staff               = staff;
         this.item                = new FileItem(id, this.fileDir + fileName);
         this.item.FileService    = this.fileService;
         this.item.ProcessEvent   = new ProcessEvent(this.ProcessEventHandle);
         this.item.EndEvent       = new EndEvent(this.EndEventHandle);
         this.item.ErrorEvent     = new ErrorEvent(this.ErrorEventHandle);
         this.item.IconBase64     = iconBase64;
         this.IconBase64          = iconBase64;
         this.imgIcon.Source      = this.IconDecode(this.IconBase64);
         this.progressBar.Maximum = (double)size;
         this.tbkFilename.Text    = fileName;
         this.fileName            = fileName;
         this.tbkMsg.Text         = "收到文件请求";
         this.tbkSize.Text        = this.GetLength(size);
         this.ShowAcceptButton();
     }
 }
コード例 #59
0
 public static string FullName(this Staff staff, bool upper = true, bool withSalutation = false)
 {
     return(FullName(staff.FirstName, staff.LastName, "", upper, withSalutation ? staff.Gender : null));
 }
コード例 #60
0
 protected override object LoadList()
 {
     return(new BindingList <Staff>(Staff.LoadList(Database)));
 }