protected virtual void PrepareHospitalAddressModel(HospitalModel model, HospitalMaster customer, bool excludeProperties, bool prepareEntireAddressModel) { if (model == null) { throw new ArgumentNullException(nameof(model)); } var address = _addressService.GetAddressById(customer.HospitalAddress != null ? customer.HospitalAddress.Id : 0); if (customer != null) { if (!excludeProperties) { if (address != null) { var Baddress = new AddressModel(); Baddress.FirstName = _encryptionService.DecryptText(address.FirstName); Baddress.LastName = _encryptionService.DecryptText(address.LastName); Baddress.PhoneNumber = _encryptionService.DecryptText(address.PhoneNumber); Baddress.StateProvince = _encryptionService.DecryptText(address.StateProvince); Baddress.ZipPostalCode = _encryptionService.DecryptText(address.ZipPostalCode); Baddress.Email = _encryptionService.DecryptText(address.Email); Baddress.City = _encryptionService.DecryptText(address.City); Baddress.Address1 = _encryptionService.DecryptText(address.Address1); Baddress.Address2 = _encryptionService.DecryptText(address.Address2); Baddress.Id = address.Id; Baddress.CreatedOnUtc = address.CreatedOnUtc; model.HospitalAddress = Baddress; } } } }
private void SetData(HospitalMaster row) { if (row.hospital_id != 0) { // 更新のとき 変更不可 this.hospital_id.IsEnabled = false; // 削除を有効に this.deleteButton.IsEnabled = true; this.hospital_id.Text = row.hospital_id.ToString(); } else { // 新規のとき 変更可 this.hospital_id.IsEnabled = true; // 削除を無効に this.deleteButton.IsEnabled = false; this.hospital_id.Text = ""; } this.hospital_name_en.Text = row.hospital_name_en; this.hospital_name_jp.Text = row.hospital_name_jp; this.hospital_name_cn.Text = row.hospital_name_cn; SelectComboByTag(this.hospital_enable, row.hospital_enable); }
/// <summary> /// Updates the hospital /// </summary> /// <param name="hospital">hospital</param> public void UpdateHospital(HospitalMaster hospital) { if (hospital == null) { throw new ArgumentNullException(nameof(hospital)); } _hospitalMasterRepository.Update(hospital); }
/// <summary> /// Insert a hospital /// </summary> /// <param name="hospital">hospital</param> public void InsertHospital(HospitalMaster hospital) { if (hospital == null) { throw new ArgumentNullException(nameof(hospital)); } _hospitalMasterRepository.Insert(hospital); }
//Delete Hospital public virtual void DeleteHospital(HospitalMaster hospital) { if (hospital == null) { throw new ArgumentNullException(nameof(hospital)); } hospital.Deleted = true; UpdateHospital(hospital); }
private void UpdateData() { if (this.comboNames.SelectedValue != null) { int id = int.Parse(this.comboNames.SelectedValue.ToString()); HospitalMaster row = BaseMasterModel.Find <HospitalMaster>(this.m_db.Conn, id); SetData(row); } }
public SectionMasterDialog() { InitializeComponent(); string localeCode = CommonUtil.GetAppLocaleCode(); InitCombo(HospitalMaster.SelectIdAndNameSql(localeCode), this.section_hospital_id); InitCombo(SectionMaster.SelectIdAndNameSql(localeCode), this.section_forward_sect); Reload <SectionMaster>(this.comboNames); }
public IActionResult Create(HospitalModel model) { ViewBag.FormName = "Hospital :#"; //permissions if (SharedData.isHospitalMenuAccessible == false) { return(AccessDeniedView()); } try { if (ModelState.IsValid) { if (model.Id == 0) { var Baddress = new Address(); //pratiksha post hospital name in Encrypt format 28/nov/2019 Baddress.FirstName = _encryptionService.EncryptText(model.HospitalAddress.FirstName); Baddress.LastName = _encryptionService.EncryptText(model.HospitalAddress.LastName); Baddress.Email = _encryptionService.EncryptText(model.HospitalAddress.Email); Baddress.PhoneNumber = _encryptionService.EncryptText(model.HospitalAddress.PhoneNumber); Baddress.StateProvince = _encryptionService.EncryptText(model.HospitalAddress.StateProvince); Baddress.ZipPostalCode = _encryptionService.EncryptText(model.HospitalAddress.ZipPostalCode); Baddress.City = _encryptionService.EncryptText(model.HospitalAddress.City); Baddress.Address1 = _encryptionService.EncryptText(model.HospitalAddress.Address1); Baddress.Address2 = _encryptionService.EncryptText(model.HospitalAddress.Address2); Baddress.CreatedOnUtc = DateTime.UtcNow; var hospital = new HospitalMaster(); hospital.HospitalName = _encryptionService.EncryptText(model.HospitalName); hospital.ContactPerson = _encryptionService.EncryptText(model.ContactPerson); hospital.Deleted = false; hospital.CreatedOn = DateTime.UtcNow; hospital.LastUpdated = DateTime.UtcNow; _hospitalServices.InsertHospital(hospital); //customer.CustomerRoles.Add(); hospital.HospitalAddress = Baddress; _hospitalServices.UpdateHospital(hospital); } AddNotification(NotificationMessage.TitleSuccess, NotificationMessage.msgAddHospital, NotificationMessage.TypeSuccess); return(RedirectToAction("Index")); } else { return(View(model)); } } catch (Exception e) { AddNotification(NotificationMessage.TitleError, NotificationMessage.ErrorMsg, NotificationMessage.TypeError); return(RedirectToAction("CreateUserCustomer")); } }
public HospitalViewModel(HospitalMaster hospital) { HospitalId = hospital.Id; Name = hospital.Name; AddressLine1 = hospital.AddressLine1; AddressLine2 = hospital.AddressLine2; Email = hospital.Email; WorkingHours = hospital.WorkingHoursFrom + " - " + hospital.WorkingHoursTo; ContactList = hospital.HospitalContacts; WorkingDaysList = hospital.HospitalWorkingDays; Departmentlist = hospital.Department.Where(m => m.IsActive == true).Select(s => new DepartmentViewModel(s)).ToList(); //Testimonials = hospital.Testimonials.Select(s => new TestimonialViewModel(s)).ToList(); //Facilitylist = hospital.Facilities.Select(s => new FacilityViewModel(s)).ToList(); }
/// <summary> /// 登録または更新ようにコントロールの値を行にを設定 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="row"></param> /// <param name="id"></param> // protected override void SetRowData<T>(T t_row, int id) protected override bool SetRowData(object t_row, int id) { HospitalMaster row = (HospitalMaster)t_row; Int16 id16; if (IsValidInt16(id.ToString(), Properties.Resources.HOSPITAL_ID, out id16)) { row.hospital_id = id16; row.hospital_name_en = this.hospital_name_en.Text; row.hospital_name_jp = this.hospital_name_jp.Text; row.hospital_name_cn = this.hospital_name_cn.Text; row.hospital_enable = (Int16)GetComboSelectedTagValue(this.hospital_enable, 0); return(true); } else { return(false); } }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { string hospital_id; string floor_id; string result = ""; string v; if (GetString(value, out v)) { if (v.Contains("_")) { string[] values = v.Split('_'); if (values.Length > 2) { hospital_id = values[1]; floor_id = values[2]; } else { hospital_id = values[0]; floor_id = values[1]; } int tmp; if (Int32.TryParse(hospital_id, out tmp) && Int32.TryParse(floor_id, out tmp)) { string localeCode = CommonUtil.GetAppLocaleCode(); string valueFieldName = "hospital_name_" + localeCode; string name1 = GetValue <string>(HospitalMaster.SelectNameSql(localeCode, hospital_id), valueFieldName); valueFieldName = "floor_name_" + localeCode; string name2 = GetValue <string>(FloorMaster.SelectNameSql(localeCode, floor_id), valueFieldName); result = name1 + "," + name2; } } } return(result); }
public int CreateUser(BusinessEntities.HospitalMasterEntity hspMasterEntity) { using (var scope = new TransactionScope()) { var hsp = new HospitalMaster { ActiveDate = hspMasterEntity.ActiveDate, Address1 = hspMasterEntity.Address1, Address2 = hspMasterEntity.Address2, BedNos = Convert.ToInt32(hspMasterEntity.BedNos), City = hspMasterEntity.City, ConfirmPassword = hspMasterEntity.ConfirmPassword, ContactPerson = hspMasterEntity.ContactPerson, District = hspMasterEntity.District, EmailId = hspMasterEntity.EmailId, GSTINNo = hspMasterEntity.GSTINNo, HospitalName = hspMasterEntity.HospitalName, IsActive = hspMasterEntity.IsActive, MobileNo = hspMasterEntity.MobileNo, NameOfOwner = hspMasterEntity.NameOfOwner, OWNER = hspMasterEntity.OWNER, Password = hspMasterEntity.Password, RegDate = hspMasterEntity.RegDate, State = hspMasterEntity.State, UserName = hspMasterEntity.UserName, UserType = Convert.ToInt32(hspMasterEntity.UserType), Pincode = hspMasterEntity.Pincode, PlantId = hspMasterEntity.PlantId, UnitType = hspMasterEntity.UserType, }; _unitOfWork.HospitalMasterRepository.Insert(hsp); _unitOfWork.Save(); scope.Complete(); return(hsp.PK_HospitalId); } }
protected override void SetID(object t_row, int id) { HospitalMaster row = (HospitalMaster)t_row; row.hospital_id = (Int16)id; }
/// <summary> /// 異常状態チェックで /// MUエラーチェック /// </summary> private void UpdateErrorForMu() { // m_errorInfo.ResetMuInfo(); string locale_code = CommonUtil.GetAppLocaleCode(); MuMaster[] mu_masters = BaseModel.GetRows <MuMaster>(m_db.Conn, "SELECT * FROM mu_master WHERE mu_enable=1"); foreach (MuMaster mu_master in mu_masters) { int mu_id = mu_master.mu_id; MuStatusLog mu_status_log = BaseModel.GetFirst <MuStatusLog>(m_db.Conn, "SELECT * FROM mu_status_log WHERE mu_log_mu_id=" + mu_id + " ORDER BY mu_log_index DESC LIMIT 1"); string message = null; bool is_error = true; if (mu_status_log.mu_log_com == 0) { // 未接続のとき // 前回のエラー情報とオペモードをリセット // ResetMuErrCode(mu_id); m_errorInfo.RemoveByMu(mu_id); ResetMuOpeMode(mu_id); int errcode = 999900009; // オフライン用に存在しないエラーコードを設定 if (!IsSameErrCode(mu_id, errcode)) { message = Properties.Resources.MLD_MUORDER_STATUS_NOCON; } is_error = false; } else if (mu_status_log.mu_log_errcode == 0) { // エラーなしのとき // 前回のエラー情報リセット ResetMuErrCode(mu_id); int ope_mode = mu_status_log.mu_log_ope_mode; if (!IsSameOpeMode(mu_id, ope_mode)) { // ope_modeに対応するメッセージを取得 message = CommonUtil.GetValueFromCSV(Properties.Resources.MLD_OPE_MODE, ope_mode); is_error = false; } } else { // エラーありのとき // 前回のope_modeリセット ResetMuOpeMode(mu_id); int errcode = mu_status_log.mu_log_errcode; if (!IsSameErrCode(mu_id, errcode)) { // levelかcodeに異常がある場合はメッセージを取得 message = CommonUtil.MuErrorMessageFormat(m_db.Conn, locale_code, mu_id, mu_status_log.mu_log_errlevel, errcode); } } if (message != null) { string mu_name = BaseModel.GetFirstValue <string>(m_db.Conn, MuMaster.SelectNameSql(locale_code, mu_id.ToString()), "mu_name_" + locale_code); // エラー発生日時を取得 DateTime updatedAt = mu_status_log.mu_log_datetime; // 発部署、着部署 // ①の mu_statusテーブルの同一レコードにあるmu_stat_order_id(搬送オーダID)がNULLの場合(搬送していない)は、発部署、着部署はブランク表示します。 // mu_stat_order_id<> NULLの場合は、このmu_stat_order_idの一致する搬送オーダテーブル(order_reserve)から該当するレコード情報から発部署、着部署(巡回、不在転送含む表示)を表示する。 (string fromSectNames, string toSectNames) = OrderReserve.GetSectNames(m_db.Conn, mu_status_log.mu_log_order_id); string other_name = "value"; // 棟名称 string hospital_name = BaseModel.GetFirstValue <string>(m_db.Conn, HospitalMaster.SelectNameSql(locale_code, mu_status_log.mu_log_hospital_id.ToString(), other_name)); // フロア名称 string floor_name = BaseModel.GetFirstValue <string>(m_db.Conn, FloorMaster.SelectNameSql(locale_code, mu_status_log.mu_log_floor_id.ToString(), other_name)); // ポイント名称 string point_name = BaseModel.GetFirstValue <string>(m_db.Conn, PointMaster.SelectNameSql(locale_code, mu_status_log.mu_log_point_last.ToString(), other_name)); // メッセージを追加 (オフラインのときは黒) this.addMessage(updatedAt, is_error ? "Red" : "Black", message, mu_name); // システム状態のリストにもメッセージが表示されるように if (m_systemStatusControl != null) { m_systemStatusControl.addMessage(updatedAt, is_error ? "Red" : "Black", message, mu_name); } int muorder_status = mu_status_log.mu_log_muorder_status; if (is_error) { // 異常情報ようにエラー情報設定 m_errorInfo.UpdateMuError(updatedAt, GetErrorBrush(muorder_status), mu_id, mu_name, message, fromSectNames, toSectNames, hospital_name, floor_name, mu_status_log.mu_log_pos_x, mu_status_log.mu_log_pos_y, point_name); } } } }
public HomeViewModel(HospitalMaster hospital) { Testimonials = hospital.Testimonials.Select(s => new TestimonialViewModel(s)).ToList(); }