void Accept() { try { if (Estate_Checkvalidate() == false) { return; } Estate_Object_Info _Estate_Object_Info = new Estate_Object_Info(); _Estate_Object_Info.Estate_Name = txt_Estate_Name.Text; _Estate_Object_Info.Note = txtNote.Text; _Estate_Object_Info.Area = txt_Estate_Area.Text; _Estate_Object_Info.Estate_Type = Convert.ToDecimal(cboType.SelectedValue); _Estate_Object_Info.Status = Convert.ToDecimal(cboStatus.SelectedValue); if (c_Estate_Object_Controller.Estate_Object_Update(c_Estate_Object_Info.Estate_Id, _Estate_Object_Info) == false) { NoteBox.Show("Lỗi sửa đối tượng bất động sản", "", NoteBoxLevel.Error); return; } NoteBox.Show("Cập nhật dữ liệu thành công", ""); this.Close(); } catch (Exception ex) { ErrorLog.log.Error(ex.ToString()); } }
private void ckAll_Click(object sender, RoutedEventArgs e) { try { if (ckAll.IsChecked == true) { NoteBox.Show("Có sự thay đổi về quyền của nhóm,quyền của người sử dụng thuộc nhóm sẽ được cập nhật lại", "", NoteBoxLevel.Note); foreach (FunctionsInfo item in dgFunctions.ItemsSource) { item.ofgroup = 1; } } else { NoteBox.Show("Đang có nhóm người dùng thuộc nhóm, những người dùng này sẽ tự động bị mất quyền", "", NoteBoxLevel.Note); foreach (FunctionsInfo item in dgFunctions.ItemsSource) { item.ofgroup = 0; } } dgFunctions.Items.Refresh(); } catch (Exception ex) { ErrorLog.log.Error(ex.ToString()); } }
private void UserLogin() { try { tblError.Visibility = Visibility.Collapsed; if (c_LoadCommonDataStatus != 2) { return; } User_Controller _User_Controller = new User_Controller(); User_Info _User_Info = _User_Controller.User_Login(txtUsername.Text, txtPassword.Text); if (_User_Info == null) { NoteBox.Show("Sai tên đăng nhập hoặc mật khẩu", "", NoteBoxLevel.Error); txtPassword.Focus(); return; } _User_Controller.User_Update_Last_Login(_User_Info.User_Id, DateTime.Now); CommonData.c_Urser_Info = _User_Info; this.DialogResult = true; this.Close(); } catch (Exception ex) { CommonData.log.Error(ex.ToString()); NoteBox.Show("Đăng nhập thất bại", "Thông báo"); } }
bool Building_Checkvalidate() { try { if (txt_Building_Code.Text == "") { NoteBox.Show("Mã tòa nhà không được để trống", "", NoteBoxLevel.Error); txt_Building_Code.Focus(); return(false); } //if (txt_Building_Name.Text == "") //{ // NoteBox.Show("Tên tòa nhà không được để trống", "", NoteBoxLevel.Error); // txt_Building_Name.Focus(); // return false; //} return(true); } catch (Exception ex) { ErrorLog.log.Error(ex.ToString()); return(false); } }
public void GroupUser_Update() { try { if (GroupUser_CheckValidate()) { MessageBoxResult result = NoteBox.Show("Bạn có muốn sửa thông tin này hay không?", "Thông báo", NoteBoxLevel.Question); if (result == MessageBoxResult.Yes) { GroupUserInfo _GroupUserInfo = new GroupUserInfo(); _GroupUserInfo.Name = txtName.Text.Trim(); _GroupUserInfo.Group_Type = c_GroupUserInfo.Group_Type; _GroupUserInfo.Note = txtNotes.Text.Trim(); if (moncon.GroupUser_Update(c_GroupUserInfo.Id, _GroupUserInfo)) { c_editOK = 1; NoteBox.Show("Cập nhật dữ liệu thành công", "Thông báo", NoteBoxLevel.Note); this.Close(); } else { NoteBox.Show("Cập nhật dữ liệu không thành công", "Thông báo", NoteBoxLevel.Error); } } } } catch (Exception ex) { CommonData.log.Error(ex.ToString()); } }
void Customer_Delete() { try { c_row_select = dgrCustomer.SelectedIndex; Customer_Info _Customer_Info = (Customer_Info)dgrCustomer.SelectedItem; if (_Customer_Info == null) { return; } MessageBoxResult result = NoteBox.Show("Bạn chắc chắn muốn khách hàng này hay không?", "Thông báo", NoteBoxLevel.Question); if (MessageBoxResult.Yes == result) { if (c_Customer_Controller.Customer_Delete(_Customer_Info.Customer_Id)) { NoteBox.Show("Xóa dữ liệu thành công"); LoadData(); } } else { DataGridHelper.NVSFocus(dgrCustomer, c_row_select, 0); } } catch (Exception ex) { CommonData.log.Error(ex.ToString()); } }
void Create_Fee_Extend() { try { if (txtFee.Text == "") { NoteBox.Show("Bạn chưa nhập phí môi giới", "", NoteBoxLevel.Error); return; } c_lst_Fee_Extend = new List <Fees_Revenue_Info>(); Fees_Revenue_Info _Fees_Revenue_Info = new Fees_Revenue_Info(); _Fees_Revenue_Info.Number_Payment = 1; _Fees_Revenue_Info.Object_Type = (decimal)Enum_Contract_Type.Renter; _Fees_Revenue_Info.Fee_Expected = Convert.ToDecimal(txtFee_Extend.Text); _Fees_Revenue_Info.Fee = 0; _Fees_Revenue_Info.Debit_Amount = _Fees_Revenue_Info.Fee_Expected; _Fees_Revenue_Info.Pay_Date_Expected = ConvertData.ConvertString2Date(dpFromDate_Extend.Text); _Fees_Revenue_Info.Is_Extend = 1; _Fees_Revenue_Info.Pay_Status = (decimal)Enum_Fee_Status.No_Pay; c_lst_Fee_Extend.Add(_Fees_Revenue_Info); dgrFee_Extend.ItemsSource = c_lst_Fee_Extend; dgrFee_Extend.Items.Refresh(); } catch (Exception ex) { ErrorLog.log.Error(ex.ToString()); } }
bool Estate_Checkvalidate() { try { if (txt_Estate_Name.Text == "") { NoteBox.Show("Tên đối tượng bất động sản không được để trống", "", NoteBoxLevel.Error); txt_Estate_Name.Focus(); return(false); } //if (txt_Estate_Area.Text == "") //{ // NoteBox.Show("Diện tích đối tượng bất động sản không được để trống", "", NoteBoxLevel.Error); // txt_Estate_Area.Focus(); // return false; //} return(true); } catch (Exception ex) { ErrorLog.log.Error(ex.ToString()); return(false); } }
private void NoteBlock_OnKeyDown(object sender, KeyEventArgs e) { if (e.Key != Key.Enter) { return; } NoteBox.Focus(); }
void Accept() { try { if (!CheckValidate_F()) { return; } Category_Controller _Category_Controller = new Category_Controller(); if (c_type == Convert.ToInt16(Form_Type.Insert)) { MessageBoxResult result = NoteBox.Show("Bạn chắc chắn muốn thêm mới nhà cung cấp hay không?", "Thông báo", NoteBoxLevel.Question); if (MessageBoxResult.Yes == result) { Category_Info _Category_Info = new Category_Info(); _Category_Info.Category_Name = txtName.Text; decimal _id = 0; if (_Category_Controller.Category_Insert(_Category_Info, ref _id)) { NoteBox.Show("Thêm mới thành công"); c_id_insert = _id; this.Close(); } else { NoteBox.Show("Có lỗi trong quá trình thêm mới", "", NoteBoxLevel.Error); } } } else { MessageBoxResult result = NoteBox.Show("Bạn chắc chắn muốn cập nhật hay không?", "Thông báo", NoteBoxLevel.Question); if (MessageBoxResult.Yes == result) { Category_Info _Category_Info = new Category_Info(); _Category_Info.Category_Name = txtName.Text; if (_Category_Controller.Category_Update(c_Category_Info.Category_Id, _Category_Info)) { NoteBox.Show("Cập nhật dữ liệu thành công"); c_id_insert = 1; this.Close(); } else { NoteBox.Show("Có lỗi trong quá trình cập nhật dữ liệu", "", NoteBoxLevel.Error); } } } } catch (Exception ex) { CommonData.log.Error(ex.ToString()); } }
private void btnCall_Extend_Click(object sender, RoutedEventArgs e) { MessageBoxResult result = NoteBox.Show("Bạn có muốn reset lại thông tin phí thanh toán hay không?", "Thông báo", NoteBoxLevel.Question); if (MessageBoxResult.Yes == result) { Create_Fee_Extend(); } }
public Respond(UserData user_data, UserFrid user_frid, MsgBox msg_box, NoteBox note_box, UserState fridstate) : base(_Type.respond) { this.user_data = user_data; this.user_frid = user_frid; this.msg_box = msg_box; this.note_box = note_box; this.fridstate = fridstate; }
void Export() { try { #region Kết xuất FlexCel.Report.FlexCelReport flcReport = new FlexCel.Report.FlexCelReport(); string _path = CommonData.ExcelDesignFilePath; string _fileExcelName = "Contract_Report_Ky.xls"; DataSet ds_all = new DataSet(); DataTable _dt = ConvertData.ConvertToDatatable(c_lst); _dt.Columns.Add("STT"); int index = 1; foreach (DataRow item in _dt.Rows) { item["STT"] = index; index++; } ds_all.Tables.Add(_dt); ds_all.Tables[0].TableName = "Contract"; if (ds_all.Tables.Count <= 0) { Mouse.OverrideCursor = null; NoteBox.Show("Không có dữ liệu để kết xuất", "Thông báo", NoteBoxLevel.Note); return; } if (ds_all.Tables[0].Rows.Count <= 0) { Mouse.OverrideCursor = null; NoteBox.Show("Không có dữ liệu để kết xuất", "Thông báo", NoteBoxLevel.Note); return; } _path += _fileExcelName; string _title_report = "BÁO CÁO KỶ Y"; CommonFunction.SetValueExportByDataTable(ref flcReport, ds_all); CommonFunction.SetValueExportByString(ref flcReport, "title_report", _title_report); System.Windows.Forms.SaveFileDialog saveReport = new System.Windows.Forms.SaveFileDialog(); saveReport.Filter = "Excel files (*.xls)|*.xls"; if (saveReport.ShowDialog() == System.Windows.Forms.DialogResult.OK) { CommonFunction.ExportExcel(flcReport, _path, saveReport); } #endregion } catch (Exception ex) { ErrorLog.log.Error(ex.ToString()); } }
private void btnCancel_Click(object sender, RoutedEventArgs e) { MessageBoxResult result = NoteBox.Show(" Bạn có muốn thoát khỏi chương trình không?", "Thông báo", NoteBoxLevel.Question); if (result == MessageBoxResult.Yes) { this.Close(); Application.Current.Shutdown(); } }
/*Clears all TextBoxes */ protected void clearAllBoxes() { SurnameBox.Clear(); NameBox.Clear(); PhoneBox.Clear(); MailBox.Clear(); CityBox.Clear(); AddressBox.Clear(); NoteBox.Clear(); }
private void User_Right_Insert() { try { if (c_change) { User_RightsController _User_RightsController = new User_RightsController(); List <User_RightsInfo> _lstRight = new List <User_RightsInfo>(); foreach (User_FunctionsInfo item in c_arrFunction) { if (item.authcode != 0) { User_RightsInfo _User_RightsInfo = ConvertToUser_RightsInfo(item, c_UsersInfo.User_Id); _User_RightsInfo.User_Name = c_UsersInfo.User_Name; _lstRight.Add(_User_RightsInfo); } } if (_lstRight.Count > 0) { MessageBoxResult result1 = NoteBox.Show("Bạn có muốn cập nhật hay không?", "", NoteBoxLevel.Question); if (result1 == MessageBoxResult.Yes) { Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait; _User_RightsController.User_Rights_DelByUser(c_UsersInfo.User_Name); _User_RightsController.User_Rights_Insert_Barth(_lstRight); Mouse.OverrideCursor = null; c_ok = 1; NoteBox.Show("Cập nhật dữ liệu thành công", "", NoteBoxLevel.Note); this.Close(); } } else { Mouse.OverrideCursor = null; NoteBox.Show("Bạn chưa đặt quyền cho chức năng nào", "", NoteBoxLevel.Error); } } else { Mouse.OverrideCursor = null; NoteBox.Show("Bạn chưa thực hiện thay đổi quyền nào", "", NoteBoxLevel.Error); } } catch (Exception ex) { Mouse.OverrideCursor = null; ErrorLog.log.Error(ex.ToString()); NoteBox.Show("Cập nhật dữ liệu không thành công", "Lỗi", NoteBoxLevel.Error); } }
void exitForm() { MessageBoxResult result = NoteBox.Show("Bạn có muốn thoát khỏi form hay không?", "Thông báo", NoteBoxLevel.Question); if (result == MessageBoxResult.Yes) { this.Close(); } else { this.Focus(); } }
private void exitForm() { MessageBoxResult result = NoteBox.Show("Bạn có muốn cập nhật thông tin nhóm người sử dụng hay không ?", "Thông báo", NoteBoxLevel.Question); if (result == MessageBoxResult.Yes) { this.Close(); } else { this.Focus(); } }
void Creat_Ri_by_Color() { try { if (!CheckValidate_F()) { return; } c_j_ao = Convert.ToInt16(txtCount_J.Text); c_from = Convert.ToInt16(txtFromAge.Text); c_to = Convert.ToInt16(txtToAge.Text); c_count = Convert.ToInt16(txtCount.Text); decimal _count = 0; foreach (Product_Detail_Info item in c_lst_Products_Detail) { _count += item.Total_Count / c_count; } if (_count == c_j_ao) { NoteBox.Show("Bạn đã nhập đủ số dây áo"); return; } frmCreate_Item _frmCreateItems = new frmCreate_Item(); _frmCreateItems.Owner = Window.GetWindow(this); _frmCreateItems.c_count = c_j_ao - _count; _frmCreateItems.ShowDialog(); if (_frmCreateItems.c_ok == 1) { Product_Detail_Info _Product_Detail_Info = new Product_Detail_Info(); _Product_Detail_Info.Name = " Ri " + (c_lst_Products_Detail.Count + 1).ToString(); _Product_Detail_Info.Color_Id = _frmCreateItems.c_ProductInfo.Color_Id; _Product_Detail_Info.Total_Count = _frmCreateItems.c_ProductInfo.Count_Ri_by_Color * c_count; _Product_Detail_Info.Ri_Count = _frmCreateItems.c_ProductInfo.Count_Ri_by_Color; _Product_Detail_Info.Size = c_from.ToString() + " - " + c_to.ToString(); _Product_Detail_Info.Color_Name = _frmCreateItems.c_ProductInfo.Color_Name; c_lst_Products_Detail.Add(_Product_Detail_Info); dgrProduct_VietNam.ItemsSource = c_lst_Products_Detail; dgrProduct_VietNam.Items.Refresh(); } } catch (Exception ex) { CommonData.log.Error(ex.ToString()); } }
private void LoadNote_Click(object sender, EventArgs e) { // Create an OpenFileDialog object. OpenFileDialog openFile1 = new OpenFileDialog(); // Initialize the filter to look for text files. openFile1.Filter = "Text Files|*.txt"; // If the user selected a file, load its contents into the RichTextBox. if (openFile1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { NoteBox.LoadFile(openFile1.FileName, RichTextBoxStreamType.PlainText); } }
private void Window_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { if (CommonData.c_Urser_Info.Pass == txtPassword.Text) { this.Close(); } else { NoteBox.Show("Mật khẩu không đúng"); txtPassword.Focus(); } } }
private void Functions_Delete() { try { if (!this.NVSQuyen_Core.RIGHT_DEL) { NoteBox.Show("Bạn không có quyền sử dụng chức năng này.", "Thông báo", NoteBoxLevel.Note); return; } FunctionsInfo _FunctionsInfo = new FunctionsInfo(); _FunctionsInfo = (FunctionsInfo)dgFunctions.SelectedItem; ArrayList arrdelete = new ArrayList(); arrdelete.Add(_FunctionsInfo); BuidlTreeFuction(_FunctionsInfo, (ArrayList)dgFunctions.ItemsSource, ref arrdelete); if (arrdelete.Count > 0) { MessageBoxResult rs = NoteBox.Show("Bạn có muốn xóa chức năng này hay không?", "Thông báo", NoteBoxLevel.Question); if (rs == MessageBoxResult.Yes) { foreach (FunctionsInfo item in arrdelete) { c_FunctionsController.Function_Delete(item.id, item.name); } NoteBox.Show("Xóa dữ liệu thành công", "", NoteBoxLevel.Note); LoadData(); if (dgFunctions.Items.Count > 0) { dgFunctions.SelectedIndex = 0; } dgFunctions.Focus(); } else if (rs == MessageBoxResult.No) { dgFunctions.Focus(); } } else { NoteBox.Show("Bạn chưa chọn dòng muốn xóa. Hãy chọn lại", "Thông báo", NoteBoxLevel.Note); } } catch (Exception ex) { CommonData.log.Error(ex.ToString()); } }
bool CheckValidate_F() { try { if (txtFullName.Text == "") { NoteBox.Show("Tên đầy đủ không được để trống không được để trống", "Lỗi", NoteBoxLevel.Error); txtFullName.Focus(); return(false); } else if (txtUserName.Text == "") { NoteBox.Show("Tên đăng nhập không được để trống không được để trống", "Lỗi", NoteBoxLevel.Error); txtUserName.Focus(); return(false); } else if (txtUserName.Text.Contains(" ")) { NoteBox.Show("Tên đăng nhập không được chứa dấu cách", "Lỗi", NoteBoxLevel.Error); txtUserName.Focus(); return(false); } else if (c_type == Convert.ToInt16(Form_Type.Insert) && !CheckUserNotSame(txtUserName.Text.Trim())) { NoteBox.Show("Tên đăng nhập đã tồn tại trong CSDL", "Lỗi", NoteBoxLevel.Error); txtUserName.Focus(); return(false); } else if (txtPass.Text == "") { NoteBox.Show("Mật khẩu không được để trống không được để trống"); txtPass.Focus(); return(false); } else if (CheckValidate.checkAllSpace(txtPass.Text)) { NoteBox.Show("Mật khẩu không được chứa toàn dấu cách", "Lỗi", NoteBoxLevel.Error); txtPass.Focus(); return(false); } return(true); } catch (Exception ex) { CommonData.log.Error(ex.ToString()); return(false); } }
private void btnExit_Click(object sender, RoutedEventArgs e) { try { MessageBoxResult result = NoteBox.Show("Bạn chắc chắn muốn thoát khỏi chương trình?", "Thông báo", NoteBoxLevel.Question); if (result == MessageBoxResult.Yes) { this.Close(); Application.Current.Shutdown(); } } catch (Exception ex) { CommonData.log.Error(ex.ToString()); } }
bool CheckValidate() { try { if (txtCustomer_Name.Text == "") { NoteBox.Show("Tên khách hàng không được để trống", "", NoteBoxLevel.Error); txtCustomer_Name.Focus(); return(false); } if (txtTotalPrice.Text == "") { NoteBox.Show("Tiền hàng không được để trống", "", NoteBoxLevel.Error); txtTotalPrice.Focus(); return(false); } if (txtTotalPrice.Text == "0") { NoteBox.Show("Tiền hàng không được bằng 0", "", NoteBoxLevel.Error); txtTotalPrice.Focus(); return(false); } if (txtPayPrice.Text == "") { NoteBox.Show("Số tiền thanh toán không được để trống", "", NoteBoxLevel.Error); txtPayPrice.Focus(); return(false); } if (txtPayPrice.Text == "0") { NoteBox.Show("Số tiền thanh toán không được bằng 0", "", NoteBoxLevel.Error); txtPayPrice.Focus(); return(false); } return(true); } catch (Exception ex) { CommonData.log.Error(ex.ToString()); return(false); } }
private void User_Right_Insert() { try { if (c_change) { User_RightsController _User_RightsController = new User_RightsController(); ArrayList arrRight = new ArrayList(); foreach (User_FunctionsInfo item in c_arrFunction) { if (item.right != "000000") { User_RightsInfo _User_RightsInfo = ConvertToUser_RightsInfo(item, c_UsersInfo.User_Id); arrRight.Add(_User_RightsInfo); } } if (arrRight.Count > 0) { MessageBoxResult result1 = NoteBox.Show("Bạn có muốn sửa thông tin này hay không?", "Thông báo", NoteBoxLevel.Question); if (result1 == MessageBoxResult.Yes) { _User_RightsController.User_Rights_DelByUser(c_UsersInfo.User_Name); _User_RightsController.User_Rights_Insert_Barth(arrRight, c_UsersInfo.User_Name); User_Controller _usC0n = new User_Controller(); _usC0n.User_Change_SetRight(c_UsersInfo.User_Id); NoteBox.Show("Cập nhật dữ liệu thành công"); this.Close(); } } else { NoteBox.Show("Bạn chưa đặt quyền cho chức năng nào", "Thông báo", NoteBoxLevel.Error); } } else { NoteBox.Show("Bạn chưa thực hiện thay đổi quyền nào", "Thông báo", NoteBoxLevel.Error); } } catch (Exception ex) { CommonData.log.Error(ex.ToString()); NoteBox.Show("Cập nhật dữ liệu không thành công", "Lỗi", NoteBoxLevel.Error); } }
private void UserLogin() { try { tblError.Visibility = Visibility.Collapsed; if (c_LoadCommonDataStatus != 2) { return; } User_Controller _User_Controller = new User_Controller(); User_Info _User_Info = _User_Controller.User_Login(txtUsername.Text, txtPassword.Text); if (_User_Info == null) { NoteBox.Show("Sai tên đăng nhập hoặc mật khẩu", "", NoteBoxLevel.Error); txtPassword.Focus(); return; } _User_Controller.User_Update_Last_Login(_User_Info.User_Id, DateTime.Now); System.Configuration.Configuration config = System.Configuration.ConfigurationManager.OpenExeConfiguration(System.Configuration.ConfigurationUserLevel.None); config.AppSettings.Settings.Remove("LastestUser"); config.AppSettings.Settings.Add("LastestUser", _User_Info.User_Name); config.AppSettings.Settings.Remove("Password"); config.AppSettings.Settings.Add("Password", txtPassword.Text); config.Save(System.Configuration.ConfigurationSaveMode.Modified); System.Configuration.ConfigurationManager.RefreshSection("appSettings"); CommonData.c_Urser_Info = _User_Info; DBMemory.LoadFunctionUsers(); this.DialogResult = true; this.Close(); } catch (Exception ex) { CommonData.log.Error(ex.ToString()); NoteBox.Show("Đăng nhập thất bại", "Thông báo"); } }
bool CheckValidate_F() { try { if (txtName.Text == "") { NoteBox.Show("Tên nhà loại sản phẩm không được để trống"); txtName.Focus(); return(false); } return(true); } catch (Exception ex) { CommonData.log.Error(ex.ToString()); return(false); } }
bool Check_validate_Fee() { try { if (c_lst_Fee.Count == 0) { NoteBox.Show("Không có thông tin thanh toán phí gia hạn", "", NoteBoxLevel.Error); tabFee.Focus(); UpdateLayout(); txtFeeOnePay.Focus(); return(false); } if (c_ok == false) { NoteBox.Show("Số tiền 1 lần thanh toán không đúng định dạng", "", NoteBoxLevel.Error); tabFee.Focus(); UpdateLayout(); return(false); } for (int i = 0; i < c_lst_Fee.Count; i++) { Fees_Revenue_Info item = c_lst_Fee[i]; string _tem = item.Fee_Expected.ToString().Replace(",", "").Trim(); if (CheckGiaDuong(_tem) == false) { tabFee.Focus(); UpdateLayout(); DataGridHelper.NVSFocus(dgrFee, i, 2); return(false); } } return(true); } catch (Exception ex) { ErrorLog.log.Error(ex.ToString()); return(false); } }
void Export_Payment() { try { c_row_select = dgrContract.SelectedIndex; Contract_Info _Contract_Info = (Contract_Info)dgrContract.SelectedItem; if (_Contract_Info == null) { return; } List <Fees_Revenue_Info> _lst = _Fees_Revenue_Controller.Fees_Revenue_GetByContract(_Contract_Info.Contract_Id); Fees_Revenue_Info _Fees_Revenue_Info = new Fees_Revenue_Info(); bool _is_not_pay = false; // kiểm tra xem đã thanh toán hết chưa foreach (Fees_Revenue_Info item in _lst) { if (item.Pay_Status == (decimal)Enum_Fee_Status.No_Pay) { _is_not_pay = true; _Fees_Revenue_Info = item; break; } } if (_is_not_pay == false) { NoteBox.Show("Đã thanh toán hết, không thể yêu cầu thanh toán", "", NoteBoxLevel.Error); return; } Estate_Object_Info _Estate_Object_Info = _Estate_Object_Controller.Estate_Object_GetById(_Contract_Info.Estate_Id, (decimal)Enum_Contract_Type.Renter); Customer_Info _Customer_Info = _Customer_Controller.Customer_GetById(_Contract_Info.Object_Id); CommonFunction.Export_payment(_Contract_Info, _Customer_Info, _Estate_Object_Info, _Fees_Revenue_Info); } catch (Exception ex) { ErrorLog.log.Error(ex.ToString()); } }
public static void readNoteBoxes() { if (File.Exists("notebox.xml")) { noteBoxColl = new List<NoteBox>(); NoteBox nb; NoteBoxLine thisnbl; List<NoteBoxLine> nblList; List<DialogueLine> thisNoteList; List<Style> slist; int stylever, lsetindex; Form1.FormMain.cmbNBStyle.Items.Clear(); XmlDocument xDocM = new XmlDocument(); try { xDocM.Load("notebox.xml"); XmlNode xDoc = xDocM.SelectSingleNode("NSSA"); XmlNodeList notes = xDoc.SelectNodes("Note"); foreach (XmlNode nnode in notes) { nb = new NoteBox(); slist = new List<Style>(3); nblList = new List<NoteBoxLine>(2); nb.name = (nnode.Attributes["name"] != null) ? nnode.Attributes["name"].Value : "Untitled"; nb.author = (nnode.Attributes["author"] != null) ? nnode.Attributes["author"].Value : "Unknown"; nb.description = (nnode.Attributes["desc"] != null) ? nnode.Attributes["desc"].Value : ""; nb.resx = (nnode.Attributes["resx"] != null) ? int.Parse(nnode.Attributes["resx"].Value) : 640; nb.resy = (nnode.Attributes["resy"] != null) ? int.Parse(nnode.Attributes["resy"].Value) : 480; XmlNode styles = nnode.SelectSingleNode("Styles"); stylever = (styles.Attributes["version"] != null) ? int.Parse(styles.Attributes["version"].Value) : 0; if (styles != null) { XmlNodeList stylelist = styles.SelectNodes("Style"); foreach (XmlNode style in stylelist) { slist.Add(Style.ParseStyle(style.InnerText, stylever)); } } nb.stylelist = slist; XmlNodeList lsets = nnode.SelectNodes("LSet"); for (lsetindex = 0; lsetindex != lsets.Count; lsetindex+=1) { XmlNode lsnode = lsets[lsetindex]; thisNoteList = new List<DialogueLine>(16); XmlNodeList lines = lsnode.SelectNodes("line"); foreach (XmlNode lnode in lines) { if (lnode.Attributes["style"]==null) thisNoteList.Add(new DialogueLine(lnode.InnerText)); else thisNoteList.Add(new DialogueLine(new Style(lnode.Attributes["style"].Value),lnode.InnerText)); } thisnbl = new NoteBoxLine(); thisnbl.lines = thisNoteList; thisnbl.maxLines = (lsnode.Attributes["lines"] != null) ? int.Parse(lsnode.Attributes["lines"].Value) : 1; nblList.Add(thisnbl); } nb.nblines = nblList; noteBoxColl.Add(nb); Form1.FormMain.cmbNBStyle.Items.Add(nb.name + " by " + nb.author); Form1.FormMain.cmbNBStyle.SelectedIndex = 0; } } catch { MessageBox.Show("Error parsing noteboxes."); } } }