public void initialize() { if (GameSetting.defaultGameLanguage.language == Languages.Chinese) { commonText = Core.content.Load <CommonText>(""); } else if (GameSetting.defaultGameLanguage.language == Languages.English) { commonText = Core.content.Load <CommonText>(""); } }
public EhrCompanyInfo(DataRow dr) { try { if (dr != null) { _mem_id = Convert.ToDecimal(CommonText.IsNull(dr["mem_id"].ToString(), "0")); _mem_name = Convert.ToString(CommonText.IsNull(dr["mem_name"].ToString(), "")); _mem_abbr = Convert.ToString(CommonText.IsNull(dr["mem_abbr"].ToString(), "")); _licence_no = Convert.ToString(CommonText.IsNull(dr["licence_no"].ToString(), "")); _type_id = Convert.ToInt16(CommonText.IsNull(dr["type_id"].ToString(), "0")); _size_id = Convert.ToInt16(CommonText.IsNull(dr["size_id"].ToString(), "0")); _loc_id = Convert.ToInt16(CommonText.IsNull(dr["loc_id"].ToString(), "0")); _address = Convert.ToString(CommonText.IsNull(dr["address"].ToString(), "")); _zipcode = Convert.ToString(CommonText.IsNull(dr["zipcode"].ToString(), "")); _mem_url = Convert.ToString(CommonText.IsNull(dr["mem_url"].ToString(), "")); _email_type = Convert.ToByte(CommonText.IsNull(dr["email_type"].ToString(), "0")); _linkman_name = Convert.ToString(CommonText.IsNull(dr["linkman_name"].ToString(), "")); _linkman_title = Convert.ToString(CommonText.IsNull(dr["linkman_title"].ToString(), "")); _linkman_gender = Convert.ToByte(CommonText.IsNull(dr["linkman_gender"].ToString(), "0")); _email = Convert.ToString(CommonText.IsNull(dr["email"].ToString(), "")); _telephone = Convert.ToString(CommonText.IsNull(dr["telephone"].ToString(), "")); _fax = Convert.ToString(CommonText.IsNull(dr["fax"].ToString(), "")); _intro = Convert.ToString(CommonText.IsNull(dr["intro"].ToString(), "")); _ind_id1 = Convert.ToInt32(CommonText.IsNull(dr["ind_id1"].ToString(), "0")); _ind_id2 = Convert.ToInt32(CommonText.IsNull(dr["ind_id2"].ToString(), "0")); _ind_id3 = Convert.ToInt32(CommonText.IsNull(dr["ind_id3"].ToString(), "0")); _reg_date = Convert.ToDateTime(CommonText.IsNull(dr["reg_date"].ToString(), DateTime.Now.ToString())); _reg_ip = Convert.ToString(CommonText.IsNull(dr["reg_ip"].ToString(), "0")); _last_update_date = Convert.ToDateTime(CommonText.IsNull(dr["last_update_date"].ToString(), DateTime.Now.ToString())); _last_login_user = Convert.ToInt32(CommonText.IsNull(dr["last_login_user"].ToString(), "0")); _last_search = Convert.ToDateTime(CommonText.IsNull(dr["last_search"].ToString(), DateTime.Now.ToString())); _last_login_date = Convert.ToDateTime(CommonText.IsNull(dr["last_login_date"].ToString(), DateTime.Now.ToString())); _login_count = Convert.ToInt32(CommonText.IsNull(dr["login_count"].ToString(), "0")); _job_option = Convert.ToInt32(CommonText.IsNull(dr["job_option"].ToString(), "0")); _savecv_table = Convert.ToString(CommonText.IsNull(dr["savecv_table"].ToString(), "")); _apply_form = Convert.ToString(CommonText.IsNull(dr["apply_form"].ToString(), "")); _logo = Convert.ToString(CommonText.IsNull(dr["logo"].ToString(), "")); _job_quota = Convert.ToInt32(CommonText.IsNull(dr["job_quota"].ToString(), "0")); _job_offlinedays = Convert.ToInt32(CommonText.IsNull(dr["job_offlinedays"].ToString(), "0")); } } catch (Exception e) { throw e; } }
/// <summary> /// 修改或者查看 /// </summary> /// <param name="id"></param> /// <param name="title"></param> /// <param name="operateService"></param> /// <param name="isReadOnly">true表示查看,默认是修改</param> public RichTextEditorForm(int id, string title, IOperateService <CommonText> operateService, Boolean isReadOnly = false) { InitializeComponent(); this.operateService = operateService; Id = id; //根据id获取内容 CommonText ct = operateService.getRow(id, title); //如果是查看 if (isReadOnly == true) { richEditControl_context.ReadOnly = true; textEdit_title.Properties.ReadOnly = true; this.Text = "查看"; this.simpleButton_save.Hide(); this.isReadOnly = isReadOnly; this.simpleButton_cancel.Text = "关闭"; } textEdit_title.Text = ct.Title; //加载内容 richEditControl_context.Document.LoadDocument(StreamByteTransfer.BytesToStream(operateService.getRow(id, title).Bytes), DocumentFormat.Rtf); }
private void simpleButton_save_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(textEdit_title.Text)) { MessageBox.Show("标题不能为空!", "提示"); return; } if (operateService.findRowByIdAndTitle(id, textEdit_title.Text)) { MessageBox.Show("标题不能重复!", "提示"); return; } CommonText ct = new CommonText(); ct.Title = textEdit_title.Text; //保存到一个临时文件中,AppData\Local\Temp string filePath = System.IO.Path.GetTempPath() + "/zxt.rtf"; richEditControl_context.Document.SaveDocument(filePath, DocumentFormat.Rtf); ct.Bytes = StreamByteTransfer.FileToBytes(filePath); //超过规定的大小后提示用户无法保存 if (ct.Bytes.LongLength > 16000 * 1000) { MessageBox.Show("图片太多, 请删除一些图片然后在保存(默认大小是16M)!", "错误"); return; } ct.Id = Id; //保存 if (id == 0 && true == operateService.addRow(ct)) { MessageBox.Show("保存成功!", "提示"); if (operateService is DisposePlanService) { LogService.getInstance().log("增加,标题为" + ct.Title, ModuleConstant.DisposePlan_MODULE); } else if (operateService is EpidemicInfoService) { LogService.getInstance().log("增加,标题为" + ct.Title, ModuleConstant.EpidemicInfo_MODULE); } else if (operateService is JobGuideBookService) { LogService.getInstance().log("增加,标题为" + ct.Title, ModuleConstant.JobGuideBook_MODULE); } else if (operateService is WorkRuleService) { LogService.getInstance().log("增加,标题为" + ct.Title, ModuleConstant.WorkRule_MODULE); } this.Close(); return; } else if (id != 0 && true == operateService.modifyRow(ct)) { MessageBox.Show("保存成功!", "提示"); if (operateService is DisposePlanService) { LogService.getInstance().log("修改,标题为" + ct.Title, ModuleConstant.DisposePlan_MODULE); } else if (operateService is EpidemicInfoService) { LogService.getInstance().log("修改,标题为" + ct.Title, ModuleConstant.EpidemicInfo_MODULE); } else if (operateService is JobGuideBookService) { LogService.getInstance().log("修改,标题为" + ct.Title, ModuleConstant.JobGuideBook_MODULE); } else if (operateService is WorkRuleService) { LogService.getInstance().log("修改,标题为" + ct.Title, ModuleConstant.WorkRule_MODULE); } this.Close(); } else { MessageBox.Show("保存失败!", "提示"); } }