public void GetTempalte(string quarterID, string templateNo) { DataTable dtTemplate = RectInterviewBus.GetTemplateInfo(quarterID); StringBuilder sbTemplateInfo = new StringBuilder(); //数据存在的时候 if (dtTemplate != null && dtTemplate.Rows.Count > 0) { //遍历所有模板信息 for (int i = 0; i < dtTemplate.Rows.Count; i++) { //获取模板编号 string no = GetSafeData.ValidateDataRow_String(dtTemplate.Rows[i], "TemplateNo"); //获取模板主题 string title = GetSafeData.ValidateDataRow_String(dtTemplate.Rows[i], "Title"); if (no == templateNo) { ddlTemplate.Items.Add(new ListItem(title, no)); //sbTemplateInfo.AppendLine("<option value=\"" + no + "\" selected=\"selected\">" + title + "</option>"); } else { ddlTemplate.Items.Add(new ListItem(title, no)); //sbTemplateInfo.AppendLine("<option value=\"" + no + "\">" + title + "</option>"); } } ddlTemplate.SelectedValue = templateNo; } }
/// <summary> /// 查询公司是否有销售模块 /// </summary> /// <param name="companyCD">公司代码</param> /// <returns></returns> public static bool IsHaveSellInfo(string companyCD) { #region 查询语句 StringBuilder searchSql = new StringBuilder(); searchSql.AppendLine(" SELECT "); searchSql.AppendLine(" COUNT(ModuleID) AS ModuleCount "); searchSql.AppendLine(" FROM "); searchSql.AppendLine(" pubdba.CompanyModule "); searchSql.AppendLine(" WHERE "); searchSql.AppendLine(" CompanyCD = @CompanyCD "); searchSql.AppendLine(" AND CONVERT(VARCHAR, ModuleID) LIKE '203%'"); #endregion //定义查询的命令 SqlCommand comm = new SqlCommand(); //公司代码 comm.Parameters.Add(SqlHelper.GetParameterFromString("@CompanyCD", companyCD)); //指定命令的SQL文 comm.CommandText = searchSql.ToString(); //执行查询 DataTable dtModuleInfo = SqlHelper.ExecuteSearch(comm); int rowCount = 0; if (dtModuleInfo != null && dtModuleInfo.Rows.Count > 0) { rowCount = GetSafeData.ValidateDataRow_Int(dtModuleInfo.Rows[0], "ModuleCount"); } return(rowCount > 0 ? true : false); }
/// <summary> /// 校验提成工资项是否被使用 /// </summary> /// <param name="itemNo">提成工资项编号</param> /// <param name="companyCD">公司代码</param> /// <returns></returns> public static bool IsUsedItem(string itemNo, string companyCD) { //校验SQL拼写 StringBuilder searchSql = new StringBuilder(); searchSql.AppendLine(" SELECT "); searchSql.AppendLine(" COUNT(*) AS UsedCount "); searchSql.AppendLine(" FROM "); searchSql.AppendLine(" officedba.CommissionSalary "); searchSql.AppendLine(" WHERE "); searchSql.AppendLine(" ItemNo = @ItemNo "); searchSql.AppendLine(" AND CompanyCD = @CompanyCD "); SqlCommand cmd = new SqlCommand(); //设置SQL语句 cmd.CommandText = searchSql.ToString(); //工资项编号 cmd.Parameters.Add(SqlHelper.GetParameterFromString("@ItemNo", itemNo)); //公司代码 cmd.Parameters.Add(SqlHelper.GetParameterFromString("@CompanyCD", companyCD)); //执行查询 DataTable dtCount = SqlHelper.ExecuteSearch(cmd); //获取记录数 int count = GetSafeData.ValidateDataRow_Int(dtCount.Rows[0], "UsedCount"); //返回结果 return(count > 0 ? true : false); }
//根据题目ID 初始化题目 //输入: // TID - 题目编号; //输出: // 如果考试题目存在:返回True; // 如果考试题目不在:返回False; public bool LoadData(int TID) { SqlParameter[] Params = new SqlParameter[1]; DataBase DB = new DataBase(); string strsql = "SELECT * FROM FillBlankProblemmr where ID=@ID"; Params[0] = DB.MakeInParam("@ID", SqlDbType.Int, 4, TID); //用户编号 DataSet ds = DB.GetStrDataSetSql(strsql, Params); ds.CaseSensitive = false; DataRow DR; if (ds.Tables[0].Rows.Count > 0) { DR = ds.Tables[0].Rows[0]; this._CourseID = GetSafeData.ValidateDataRow_N(DR, "CourseID"); //科目编号 this._FrontTitle = GetSafeData.ValidateDataRow_S(DR, "FrontTitle"); //题目前部分 this._BackTitle = GetSafeData.ValidateDataRow_S(DR, "BackTitle"); //题目后部分 this._Answer = GetSafeData.ValidateDataRow_S(DR, "Answer"); //答案 return(true); } else { return(false); } }
/// <summary> /// 根据面试模板ID,获取模板信息,并设置到页面显示 /// </summary> /// <param name="templateID">模板ID</param> private void InitTemplateInfo(string templateID) { //设置编号可见 divCodeNo.Attributes.Add("style", "display:block;"); //自动生成编号的控件设置为不可见 divCodeRule.Attributes.Add("style", "display:none;"); //查询考试信息 DataSet dsTemplateInfo = RectCheckTemplateBus.GetRectCheckTemplateInfoWithID(templateID); //获取考试基本信息 DataTable dtBaseInfo = dsTemplateInfo.Tables[0]; //基本信息存在时 if (dtBaseInfo != null && dtBaseInfo.Rows.Count > 0) { #region 设置基本信息 //模板编号 divCodeNo.InnerHtml = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "TemplateNo"); //主题 txtTitle.Text = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "Title"); //岗位 ddlQuarter.SelectedValue = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "QuarterID"); //考试状态 txtRemark.Text = GetSafeData.ValidateDataRow_String(dtBaseInfo.Rows[0], "Remark"); #endregion //设置要素信息 InitElemInfo(dsTemplateInfo.Tables[1]); } }
/// <summary> /// 根据参数userId,获取购物篮详细信息 /// </summary> /// <param name="userId">用户ID</param> public void LoadData(int userId) { Database db = new Database(); //实例化一个Database类 string sql = ""; sql = "Select * from [Cart] where UserID = " + userId; SqlDataReader reader = db.GetDataReader(sql); //利用Database类的GetDataRow方法查询用户数据 //根据查询得到的数据,对成员安全赋值 while (reader.Read()) { if (this._cartId == 0) { this._cartId = GetSafeData.ValidateDataReader_N(reader, "CartId"); this._userId = GetSafeData.ValidateDataReader_N(reader, "UserId"); } this._books.Add(GetSafeData.ValidateDataReader_N(reader, "BookId")); this._amount.Add(GetSafeData.ValidateDataReader_N(reader, "Amount")); this._exist = true; } if (this._cartId == 0) { this._exist = false; } }
/// <summary> /// 根据参数loginName,获取用户详细信息 /// </summary> /// <param name="czy">用户登录名</param> public void LoadData(string czy) { Database db = new Database(); //实例化一个Database类 string sql = ""; sql = "Select * from [czyb],[yxb] where czy = " + SqlStringConstructor.GetQuotedString(czy) + " And [czyb].yxbh=[yxb].yxbh"; DataRow dr = db.GetDataRow(sql); //利用Database类的GetDataRow方法查询用户数据 //根据查询得到的数据,对成员赋值 if (dr != null) { this._czy = GetSafeData.ValidateDataRow_S(dr, "czy"); this._dlmm = GetSafeData.ValidateDataRow_S(dr, "dlmm"); this._yxmc = GetSafeData.ValidateDataRow_S(dr, "yxmc"); this._qx = GetSafeData.ValidateDataRow_S(dr, "qx"); //解密口令 this._dlmm = Encrypt.DecryptString(_dlmm, _czy); this._exist = true; } else { this._exist = false; } }
public BMBaseModel GetModel(string BM) { DataTable kH = this.bmkhDAL.GetKH(BM); BMKHModel model = new BMKHModel(); if (kH.Rows.Count > 0) { DataRow row = kH.Rows[0]; model.BM = GetSafeData.ValidateValue <string>(row, "BM"); model.MC = GetSafeData.ValidateValue <string>(row, "MC"); model.JM = GetSafeData.ValidateValue <string>(row, "JM"); model.KJM = GetSafeData.ValidateValue <string>(row, "KJM"); model.SH = GetSafeData.ValidateValue <string>(row, "SH"); model.DZDH = GetSafeData.ValidateValue <string>(row, "DZDH"); model.YHZH = GetSafeData.ValidateValue <string>(row, "YHZH"); model.YJDZ = GetSafeData.ValidateValue <string>(row, "YJDZ"); model.BZ = GetSafeData.ValidateValue <string>(row, "BZ"); model.YSKM = GetSafeData.ValidateValue <string>(row, "YSKM"); model.DQBM = GetSafeData.ValidateValue <string>(row, "DQBM"); model.DQMC = GetSafeData.ValidateValue <string>(row, "DQMC"); model.DQKM = GetSafeData.ValidateValue <string>(row, "DQKM"); model.SJBM = GetSafeData.ValidateValue <string>(row, "SJBM"); model.SFZJY = GetSafeData.ValidateValue <bool>(row, "SFZJY"); } return(model); }
/// <summary> /// 根据参数Jxbbh,获取教学班详细信息 /// </summary> /// <param name="jxbbh">教学班编号</param> public void LoadData(string jsbh, string bjmc, string sxlx, string kbxn, string kbxq) { Database db = new Database(); //实例化一个Database类 string sql = ""; sql = "Select * from [sxb],[jsb],[yxb],[bjb] where [jsb].jsbh = " + SqlStringConstructor.GetQuotedString(jsbh) + " And [bjb].bjmc = " + SqlStringConstructor.GetQuotedString(bjmc) + " And sxlx = " + SqlStringConstructor.GetQuotedString(sxlx) + " And kbxn = " + SqlStringConstructor.GetQuotedString(kbxn) + " And kbxq =" + SqlStringConstructor.GetQuotedString(kbxq) + "And [sxb].jsbh=[jsb].jsbh And [sxb].bjbh=[bjb].bjbh And [sxb].yxbh=[yxb].yxbh"; DataRow dr = db.GetDataRow(sql); //利用Database类的GetDataRow方法查询用户数据 //根据查询得到的数据,对成员赋值 if (dr != null) { this._jsxm = GetSafeData.ValidateDataRow_S(dr, "jsxm"); this._bjmc = GetSafeData.ValidateDataRow_S(dr, "bjmc"); this._sxmc = GetSafeData.ValidateDataRow_S(dr, "sxmc"); this._sxlx = GetSafeData.ValidateDataRow_S(dr, "sxlx"); this._yxmc = GetSafeData.ValidateDataRow_S(dr, "yxmc"); this._sxzsts = GetSafeData.ValidateDataRow_F(dr, "sxzsts"); this._kbxn = GetSafeData.ValidateDataRow_S(dr, "kbxn"); this._kbxq = GetSafeData.ValidateDataRow_S(dr, "kbxq"); this._jsbh = GetSafeData.ValidateDataRow_S(dr, "jsbh"); this._bjbh = GetSafeData.ValidateDataRow_S(dr, "bjbh"); this._yxbh = GetSafeData.ValidateDataRow_S(dr, "yxbh"); this._exist = true; } else { this._exist = false; } }
/// <summary> /// 获取并设置人员信息 /// </summary> /// <param name="ID">ID</param> private void InitEmployeInfo(string ID) { //获取申请单数据 DataTable dtEmpl = EmployeeInfoBus.GetEmplDeptInfoWithID(ID); //数据存在时,设置值 if (dtEmpl != null && dtEmpl.Rows.Count > 0) { //调职人 txtEmployeeID.Value = GetSafeData.ValidateDataRow_String(dtEmpl.Rows[0], "ID"); divCodeNo.Attributes.Add("style", "width:60%;"); //员工编号 txtEmployeeNo.Text = GetSafeData.ValidateDataRow_String(dtEmpl.Rows[0], "EmployeeNo"); //员工名 txtEmployeeName.Text = GetSafeData.ValidateDataRow_String(dtEmpl.Rows[0], "EmployeeName"); //原部门名称 txtNowDeptName.Text = GetSafeData.ValidateDataRow_String(dtEmpl.Rows[0], "DeptName"); //原部门ID txtNowDeptID.Value = GetSafeData.ValidateDataRow_String(dtEmpl.Rows[0], "DeptID"); //原岗位名 txtNowQuarterName.Text = GetSafeData.ValidateDataRow_String(dtEmpl.Rows[0], "QuarterName"); //原岗位ID txtNowQuarterID.Value = GetSafeData.ValidateDataRow_String(dtEmpl.Rows[0], "QuarterID"); //原岗位职等名称 txtNowQuarterAdminName.Text = GetSafeData.ValidateDataRow_String(dtEmpl.Rows[0], "AdminLevelName"); //原岗位职等ID txtNowQuarterAdminID.Value = GetSafeData.ValidateDataRow_String(dtEmpl.Rows[0], "AdminLevelID"); //设置不可编辑 txtEmployeeNo.Enabled = false; } }
public string ExportData(string pathFile, string separator, DataTable khTable = null) { DataTable exportData; string path = pathFile.Remove(pathFile.LastIndexOf(@"\")); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } if (khTable == null) { exportData = this.bmkhDAL.GetExportData(); } else { exportData = khTable; } if (exportData.Rows.Count == 0) { return("没有客户"); } StringBuilder builder = new StringBuilder(); using (StreamWriter writer = new StreamWriter(pathFile, false, ToolUtil.GetEncoding())) { writer.WriteLine("{客户编码}[分隔符]\"" + separator + "\""); writer.WriteLine("// 每行格式 :"); string str2 = "// 编码,名称,简码,税号,地址电话,银行账号,邮件地址,备注,身份证校验"; writer.WriteLine(str2.Replace(",", separator)); for (int i = 0; i < exportData.Rows.Count; i++) { builder.Remove(0, builder.Length); builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["BM"].ToString(), separator)); builder.Append(separator); builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["MC"].ToString(), separator)); builder.Append(separator); builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["JM"].ToString(), separator)); if (exportData.Rows[i]["WJ"].ToString() == "1") { builder.Append(separator); builder.Append(exportData.Rows[i]["SH"]); builder.Append(separator); string item = exportData.Rows[i]["DZDH"].ToString().Replace("\r\n", "#|#"); builder.Append(GetSafeData.ExportItem(item, separator)); builder.Append(separator); string str4 = exportData.Rows[i]["YHZH"].ToString().Replace("\r\n", "#|#"); builder.Append(GetSafeData.ExportItem(str4, separator)); builder.Append(separator); builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["YJDZ"].ToString(), separator)); builder.Append(separator); builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["BZ"].ToString(), separator)); builder.Append(separator); builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["SFZJY"].ToString(), separator)); } builder.Replace(",,", ",\"\","); writer.WriteLine(builder.ToString()); } } return("0"); }
/// <summary> /// 根据ID获取信息 /// </summary> /// <returns></returns> public static CodeReasonFeeModel GetThreeCodeById(int id, string TableName) { CodeReasonFeeModel model = new CodeReasonFeeModel(); string sql = "select * from " + TableName + " where id=@id "; SqlParameter[] param = new SqlParameter[1]; param[0] = SqlHelper.GetParameter("@id", id); DataTable dt = SqlHelper.ExecuteSql(sql, param); DataRow data = dt.Rows[0]; if (dt.Rows.Count > 0) { model.CodeName = GetSafeData.ValidateDataRow_String(data, "CodeName"); model.ModifiedDate = GetSafeData.ValidateDataRow_DateTime(data, "ModifiedDate"); model.UsedStatus = GetSafeData.ValidateDataRow_String(data, "UsedStatus"); model.ModifiedUserID = GetSafeData.ValidateDataRow_String(data, "ModifiedUserID"); model.Flag = GetSafeData.ValidateDataRow_Int(data, "Flag"); model.CompanyCD = GetSafeData.ValidateDataRow_String(data, "CompanyCD"); model.Description = GetSafeData.ValidateDataRow_String(data, "Description"); if (TableName == "officedba.CodeUnitType")// 往来单位 { model.CodeSymbol = GetSafeData.ValidateDataRow_String(data, "CodeSymbol"); } return(model); } else { return(null); } }
/// <summary> /// 根据参数kcbh,获取课程详细信息 /// </summary> /// <param name="kcbh">课程编号/param> public void LoadData(string kcbh) { Database db = new Database(); //实例化一个Database类 string sql = ""; sql = "Select * from [kcb] where kcbh = " + SqlStringConstructor.GetQuotedString(kcbh); DataRow dr = db.GetDataRow(sql); //利用Database类的GetDataRow方法查询数据 //根据查询得到的数据,对成员赋值 if (dr != null) { this._kcbh = GetSafeData.ValidateDataRow_S(dr, "Kcbh"); this._kcmc = GetSafeData.ValidateDataRow_S(dr, "Kcmc"); this._kcxz = GetSafeData.ValidateDataRow_S(dr, "Kcxz"); this._kclx = GetSafeData.ValidateDataRow_S(dr, "Kclx"); this._fdkcsj = GetSafeData.ValidateDataRow_B(dr, "Fdkcsj"); this._yxbz = GetSafeData.ValidateDataRow_B(dr, "Yxbz"); this._exist = true; } else { this._exist = false; } }
//根据题目ID 初始化题目 //输入: // TID - 题目编号; //输出: // 题目存在:返回True; // 题目不在:返回False; public bool LoadData(int TID) { SqlParameter[] Params = new SqlParameter[1]; DataBase DB = new DataBase(); Params[0] = DB.MakeInParam("@ID", SqlDbType.Int, 4, TID); //用户编号 DataSet ds = DB.GetDataSet("Proc_DatiDetail", Params); ds.CaseSensitive = false; DataRow DR; if (ds.Tables[0].Rows.Count > 0) { DR = ds.Tables[0].Rows[0]; this._CourseID = GetSafeData.ValidateDataRow_N(DR, "CourseID"); //科目编号 this._ImgFile = GetSafeData.ValidateDataRow_S(DR, "Img"); //图片url this._Title = GetSafeData.ValidateDataRow_S(DR, "Title"); //大题信息 this._nandu = GetSafeData.ValidateDataRow_N(DR, "Nandu"); //难度 this._zhang = GetSafeData.ValidateDataRow_N(DR, "Zhang"); //章 this._jie = GetSafeData.ValidateDataRow_N(DR, "Jie"); //节 return(true); } else { return(false); } }
public XSDJ_MXModel GetMXModel(string XSDJBH, string XH) { XSDJ_MXModel model = new XSDJ_MXModel(); Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary.Add("XSDJBH", XSDJBH); dictionary.Add("XH", XH); DataTable table = this.baseDAO.querySQLDataTable("aisino.Fwkp.Wbjk.XSDJMXGetModel", dictionary); if (table.Rows.Count > 0) { DataRow row = table.Rows[0]; model.XSDJBH = GetSafeData.ValidateValue <string>(row, "XSDJBH"); model.XH = GetSafeData.ValidateValue <int>(row, "XH"); model.SL = GetSafeData.ValidateValue <double>(row, "SL"); model.DJ = GetSafeData.ValidateValue <double>(row, "DJ"); model.JE = GetSafeData.ValidateValue <double>(row, "JE"); model.SLV = GetSafeData.ValidateValue <double>(row, "SLV"); model.SE = GetSafeData.ValidateValue <double>(row, "SE"); model.SPMC = GetSafeData.ValidateValue <string>(row, "SPMC"); model.SPSM = GetSafeData.ValidateValue <string>(row, "SPSM"); model.GGXH = GetSafeData.ValidateValue <string>(row, "GGXH"); model.JLDW = GetSafeData.ValidateValue <string>(row, "JLDW"); model.HSJBZ = GetSafeData.ValidateValue <bool>(row, "HSJBZ"); model.DJHXZ = GetSafeData.ValidateValue <int>(row, "DJHXZ"); model.FPZL = GetSafeData.ValidateValue <string>(row, "FPZL"); model.FPDM = GetSafeData.ValidateValue <string>(row, "FPDM"); model.FPHM = GetSafeData.ValidateValue <int>(row, "FPHM"); model.SCFPXH = GetSafeData.ValidateValue <int>(row, "SCFPXH"); } return(model); }
//根据题目ID 初始化题目 //输入: // TID - 题目编号; //输出: // 题目存在:返回True; // 题目不在:返回False; public bool LoadData(int TID) { SqlParameter[] Params = new SqlParameter[1]; Datacon DB = new Datacon(); Params[0] = DB.MakeInParam("@ID", SqlDbType.Int, 4, TID); //用户编号 DataSet ds = DB.GetDataSet("Proc_JudgeProblemDetail", Params); ds.CaseSensitive = false; DataRow DR; if (ds.Tables[0].Rows.Count > 0) { DR = ds.Tables[0].Rows[0]; this._c_id = GetSafeData.ValidateDataRow_N(DR, "c_id"); //科目编号 this._Title = GetSafeData.ValidateDataRow_S(DR, "Title"); //题目 this._Answer = GetSafeData.ValidateDataRow_B(DR, "Answer"); //答案 return(true); } else { return(false); } }
public void LoadDataJXB2(string jxbmc) { Database db = new Database(); //实例化一个Database类 string sql = ""; sql = "Select * from [jxbb] where jxbmc = " + SqlStringConstructor.GetQuotedString(jxbmc); DataRow dr = db.GetDataRow(sql); //利用Database类的GetDataRow方法查询用户数据 //根据查询得到的数据,对成员赋值 if (dr != null) { this._jxbbh = GetSafeData.ValidateDataRow_S(dr, "jxbbh"); this._jxbmc = GetSafeData.ValidateDataRow_S(dr, "jxbmc"); this._jxbzrs = GetSafeData.ValidateDataRow_S(dr, "jxbzrs"); this._exist = true; } else { this._exist = false; } }
//根据用户 UserID 初始化该用户 //输入: // XUserID - 用户编号; //输出: // 用户存在:返回True; // 用户不在:返回False; public bool LoadData(int XUserID) { SqlParameter[] Params = new SqlParameter[1]; DataBase DB = new DataBase(); Params[0] = DB.MakeInParam("@UserID", SqlDbType.VarChar, 50, XUserID); //用户编号 DataSet ds = DB.GetDataSet("Proc_UsersDetail", Params); ds.CaseSensitive = false; DataRow DR; if (ds.Tables[0].Rows.Count > 0) { DR = ds.Tables[0].Rows[0]; this._userID = GetSafeData.ValidateDataRow_N(DR, "UserID"); //用户编号 this._userPower = GetSafeData.ValidateDataRow_N(DR, "UserPower"); //用户权限 this._userName = GetSafeData.ValidateDataRow_S(DR, "UserName"); //用户姓名 this._userEmail = GetSafeData.ValidateDataRow_S(DR, "UserEmail"); //用户邮箱 this._userNum = GetSafeData.ValidateDataRow_S(DR, "UserNum"); //用户学号 return(true); } else { return(false); } }
/// <summary> /// 根据参数jsbh,获取教师详细信息 /// </summary> /// <param name="jsbh">教师编号/param> public void LoadData(string jsbh) { Database db = new Database(); //实例化一个Database类 string sql = ""; sql = "Select * from [jsb],[yxb],[zwb],[zcb] where jsbh = " + SqlStringConstructor.GetQuotedString(jsbh) + "And [jsb].yxbh = [yxb].yxbh And [jsb].zcbh = [zcb].zcbh And [jsb].zwbh = [zwb].zwbh"; DataRow dr = db.GetDataRow(sql); //利用Database类的GetDataRow方法查询数据 //根据查询得到的数据,对成员赋值 if (dr != null) { this._jsbh = GetSafeData.ValidateDataRow_S(dr, "Jsbh"); this._jsxm = GetSafeData.ValidateDataRow_S(dr, "Jsxm"); this._jsxb = GetSafeData.ValidateDataRow_S(dr, "Jsxb"); this._yxmc = GetSafeData.ValidateDataRow_S(dr, "Yxmc"); this._zcmc = GetSafeData.ValidateDataRow_S(dr, "Zcmc"); this._zwlx = GetSafeData.ValidateDataRow_S(dr, "Zwlx"); this._dlmm = GetSafeData.ValidateDataRow_S(dr, "Dlmm"); this._zzzt = GetSafeData.ValidateDataRow_B(dr, "Zzzt"); //解密口令 this._dlmm = Encrypt.DecryptString(_dlmm, _jsbh); this._exist = true; } else { this._exist = false; } }
public void LoadInfo(string authorID) { string sql = "select * from author where authorID=" + SQLString.GetQuotedString(authorID); Database db = new Database(); DataRow dr = db.GetDataRow(sql); if (dr != null) { this._authorID = GetSafeData.ValidateDataRow_S(dr, "authorID"); this._authorPwd = GetSafeData.ValidateDataRow_S(dr, "authorPwd"); this._authorName = GetSafeData.ValidateDataRow_S(dr, "authorName"); this._authorSex = GetSafeData.ValidateDataRow_S(dr, "authorSex"); this._authorBirth = GetSafeData.ValidateDataRow_S(dr, "authorBirth"); this._authorRegion = GetSafeData.ValidateDataRow_S(dr, "authorRegion"); this._authorPost = GetSafeData.ValidateDataRow_S(dr, "authorPost"); this._authorMail = GetSafeData.ValidateDataRow_S(dr, "authorMail"); this._authorDegree = GetSafeData.ValidateDataRow_S(dr, "authorDegree"); this._authorMajor = GetSafeData.ValidateDataRow_S(dr, "authorMajor"); this._authorTitle = GetSafeData.ValidateDataRow_S(dr, "authorTitle"); this._authorJob = GetSafeData.ValidateDataRow_S(dr, "authorJob"); this._authorCompany = GetSafeData.ValidateDataRow_S(dr, "authorCompany"); this._authorPhone = GetSafeData.ValidateDataRow_S(dr, "authorPhone"); this._authorAddress = GetSafeData.ValidateDataRow_S(dr, "authorAddress"); this._authorInfo = GetSafeData.ValidateDataRow_S(dr, "authorInfo"); this._exist = true; } else { this._exist = false; } }
//根据题目ID 初始化题目 //输入: // TID - 题目编号; //输出: // 题目存在:返回True; // 题目不在:返回False; public bool LoadData(int TID) { SqlParameter[] Params = new SqlParameter[1]; DataBase DB = new DataBase(); Params[0] = DB.MakeInParam("@ID", SqlDbType.Int, 4, TID); //用户编号 DataSet ds = DB.GetDataSet("Proc_SingleProblemDetail", Params); ds.CaseSensitive = false; DataRow DR; if (ds.Tables[0].Rows.Count > 0) { DR = ds.Tables[0].Rows[0]; this._CourseID = GetSafeData.ValidateDataRow_N(DR, "CourseID"); //科目编号 this._Title = GetSafeData.ValidateDataRow_S(DR, "Title"); //题目 this._AnswerA = GetSafeData.ValidateDataRow_S(DR, "AnswerA"); //答案A this._AnswerB = GetSafeData.ValidateDataRow_S(DR, "AnswerB"); //答案B this._AnswerC = GetSafeData.ValidateDataRow_S(DR, "AnswerC"); //答案C this._AnswerD = GetSafeData.ValidateDataRow_S(DR, "AnswerD"); //答案D this._Answer = GetSafeData.ValidateDataRow_S(DR, "Answer"); //答案 this._DiffID = GetSafeData.ValidateDataRow_N(DR, "DiffID"); //难度系数 return(true); } else { return(false); } }
public BMBaseModel GetModel(string BM) { DataTable sPFL = this.bmspflDAL.GetSPFL(BM); BMSPModel model = new BMSPModel(); if (sPFL.Rows.Count > 0) { DataRow row = sPFL.Rows[0]; model.BM = GetSafeData.ValidateValue <string>(row, "BM"); model.MC = GetSafeData.ValidateValue <string>(row, "MC"); model.JM = GetSafeData.ValidateValue <string>(row, "JM"); model.KJM = GetSafeData.ValidateValue <string>(row, "KJM"); model.SJBM = GetSafeData.ValidateValue <string>(row, "SJBM"); model.SLV = GetSafeData.ValidateValue <double>(row, "SLV"); model.SPSM = GetSafeData.ValidateValue <string>(row, "SPSM"); model.GGXH = GetSafeData.ValidateValue <string>(row, "GGXH"); model.JLDW = GetSafeData.ValidateValue <string>(row, "JLDW"); model.DJ = GetSafeData.ValidateValue <double>(row, "DJ"); model.HSJBZ = GetSafeData.ValidateValue <bool>(row, "HSJBZ"); model.XSSRKM = GetSafeData.ValidateValue <string>(row, "XSSRKM"); model.YJZZSKM = GetSafeData.ValidateValue <string>(row, "YJZZSKM"); model.XSTHKM = GetSafeData.ValidateValue <string>(row, "XSTHKM"); model.HYSY = GetSafeData.ValidateValue <bool>(row, "HYSY"); model.XTHASH = GetSafeData.ValidateValue <string>(row, "XTHASH"); model.XTCODE = GetSafeData.ValidateValue <string>(row, "XTCODE"); model.ISHIDE = GetSafeData.ValidateValue <string>(row, "ISHIDE"); } return(model); }
public string ExportData(string pathFile, string separator, DataTable khTable = null) { string path = pathFile.Remove(pathFile.LastIndexOf(@"\")); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } DataTable exportData = this.bmfyxmDAL.GetExportData(); if (exportData.Rows.Count == 0) { return("没有费用项目"); } StringBuilder builder = new StringBuilder(); using (StreamWriter writer = new StreamWriter(pathFile, false, ToolUtil.GetEncoding())) { writer.WriteLine("{费用项目编码}[分隔符]\"" + separator + "\""); writer.WriteLine("// 每行格式 :"); string str2 = ""; if (Flbm.IsYM()) { str2 = "// 编码~~名称~~简码~~商品分类~~是否享受优惠政策~~税收分类名称~~优惠政策类型~~编码版本号"; } else { str2 = "// 编码~~名称~~简码"; } writer.WriteLine(str2.Replace(",", separator)); string maxBMBBBH = new SPFLService().GetMaxBMBBBH(); for (int i = 0; i < exportData.Rows.Count; i++) { builder.Remove(0, builder.Length); builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["BM"].ToString(), separator)); builder.Append(separator); builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["MC"].ToString(), separator)); builder.Append(separator); builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["JM"].ToString(), separator)); if (Flbm.IsYM()) { builder.Append(separator); builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["SPFL"].ToString(), separator)); builder.Append(separator); builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["YHZC"].ToString(), separator)); builder.Append(separator); builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["SPFLMC"].ToString(), separator)); builder.Append(separator); builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["YHZCMC"].ToString(), separator)); builder.Append(separator); builder.Append(GetSafeData.ExportItem(maxBMBBBH, separator)); } builder.Replace(",,", ",\"\","); writer.WriteLine(builder.ToString()); } } return("0"); }
private static OtherCorpInfoModel ChangeOtherCorpInfoModel(DataRow data) { //定义返回的 EmployeeInfoModel OtherCorpInfoModel model = new OtherCorpInfoModel(); //人员信息存在时,转化为model形式的数据 if (data != null) { model.ID = GetSafeData.ValidateDataRow_Int(data, "ID"); model.CompanyCD = GetSafeData.ValidateDataRow_String(data, "CompanyCD"); model.BigType = GetSafeData.ValidateDataRow_String(data, "BigType"); model.CustNo = GetSafeData.ValidateDataRow_String(data, "CustNo"); model.CustName = GetSafeData.ValidateDataRow_String(data, "CustName"); model.CorpNam = GetSafeData.ValidateDataRow_String(data, "CorpNam"); model.PYShort = GetSafeData.ValidateDataRow_String(data, "PYShort"); model.CustNote = GetSafeData.ValidateDataRow_String(data, "CustNote"); model.AreaID = GetSafeData.GetStringFromInt(data, "AreaID"); model.CompanyType = GetSafeData.ValidateDataRow_String(data, "CompanyType"); model.StaffCount = GetSafeData.GetStringFromInt(data, "StaffCount"); model.SetupDate = GetSafeData.ValidateDataRow_String(data, "SetupDate"); model.ArtiPerson = GetSafeData.ValidateDataRow_String(data, "ArtiPerson"); model.SetupMoney = GetSafeData.GetStringFromDecimal(data, "SetupMoney"); model.SetupAddress = GetSafeData.ValidateDataRow_String(data, "SetupAddress"); model.CapitalScale = GetSafeData.GetStringFromDecimal(data, "CapitalScale"); model.SaleroomY = GetSafeData.GetStringFromDecimal(data, "SaleroomY"); model.ProfitY = GetSafeData.GetStringFromDecimal(data, "ProfitY"); model.TaxCD = GetSafeData.ValidateDataRow_String(data, "TaxCD"); model.BusiNumber = GetSafeData.ValidateDataRow_String(data, "BusiNumber"); model.isTax = GetSafeData.ValidateDataRow_String(data, "isTax"); model.SellArea = GetSafeData.ValidateDataRow_String(data, "SellArea"); model.CountryID = GetSafeData.GetStringFromInt(data, "CountryID"); model.Province = GetSafeData.ValidateDataRow_String(data, "Province"); model.City = GetSafeData.ValidateDataRow_String(data, "City"); model.Post = GetSafeData.ValidateDataRow_String(data, "Post"); model.ContactName = GetSafeData.ValidateDataRow_String(data, "ContactName"); model.Tel = GetSafeData.ValidateDataRow_String(data, "Tel"); model.Fax = GetSafeData.ValidateDataRow_String(data, "Fax"); model.Mobile = GetSafeData.ValidateDataRow_String(data, "Mobile"); model.email = GetSafeData.ValidateDataRow_String(data, "email"); model.Addr = GetSafeData.ValidateDataRow_String(data, "Addr"); model.BillType = GetSafeData.ValidateDataRow_String(data, "BillType"); model.PayType = GetSafeData.GetStringFromInt(data, "PayType"); model.MoneyType = GetSafeData.GetStringFromInt(data, "MoneyType"); model.CurrencyType = GetSafeData.GetStringFromInt(data, "CurrencyType"); model.Remark = GetSafeData.ValidateDataRow_String(data, "Remark"); model.UsedStatus = GetSafeData.ValidateDataRow_String(data, "UsedStatus"); model.Creator = GetSafeData.GetStringFromInt(data, "Creator"); model.CreateDate = GetSafeData.GetStringFromDateTime(data, "CreateDate", "yyyy-MM-dd"); model.ModifiedDate = GetSafeData.GetStringFromDateTime(data, "ModifiedDate", "yyyy-MM-dd"); model.ModifiedUserID = GetSafeData.ValidateDataRow_String(data, "ModifiedUserID"); model.EmployeeName = GetSafeData.ValidateDataRow_String(data, "EmployeeName"); } return(model); }
public void ChooseYHZCMCForFYXM() { DataTable table = new DAL.BMFYXMManager().QueryFYXMYHZCIsAndYHZCMCIsEmpty(); if (table != null) { DAL.BMSPFLManager manager2 = new DAL.BMSPFLManager(); List <string> sqlID = new List <string>(); List <Dictionary <string, object> > param = new List <Dictionary <string, object> >(); for (int i = 0; i < table.Rows.Count; i++) { Dictionary <string, object> item = new Dictionary <string, object>(); string str = GetSafeData.ValidateValue <string>(table.Rows[i], "BM"); string bm = GetSafeData.ValidateValue <string>(table.Rows[i], "SPFL"); string str3 = GetSafeData.ValidateValue <string>(table.Rows[i], "YHZC"); string sPFLMCBYBM = manager2.GetSPFLMCBYBM(bm); string str5 = ""; object[] objArray = ServiceFactory.InvokePubService("Aisino.Fwkp.Bmgl.GetSLV_BY_BM", new object[] { bm }); if ((objArray != null) && (objArray.Length > 0)) { string[] strArray = (objArray[0] as DataTable).Rows[0]["ZZSTSGL"].ToString().Split(new char[] { ',', '、', ';', ',', ';' }); if (strArray.Length > 0) { str5 = strArray[0]; if ((!Flbm.IsDK() && (strArray.Length == 1)) && strArray[0].Contains("1.5%")) { str3 = "否"; str5 = ""; } if ((!Flbm.IsDK() && (strArray.Length > 1)) && strArray[0].Contains("1.5%")) { str5 = strArray[1]; } } else { str3 = "否"; } } else { str3 = "否"; } item.Add("BM", str); item.Add("SPFL", bm); item.Add("SPFLMC", sPFLMCBYBM); item.Add("YHZC", str3); item.Add("YHZCMC", str5); sqlID.Add("aisino.Fwkp.Bmgl.BMSPFL.UpdateFYXMSPFL"); param.Add(item); } new DAL.BMSPFLManager().UpdateSPFLTable(sqlID, param, false); } }
public void LoadInfo(string adminID) { string sql = "select * from admin where adminID=" + SQLString.GetQuotedString(adminID); Database db = new Database(); DataRow dr = db.GetDataRow(sql); if (dr != null) { this._adminID = GetSafeData.ValidateDataRow_S(dr, "adminID"); this._adminPwd = GetSafeData.ValidateDataRow_S(dr, "adminPwd"); } }
public BMXZQYModel GetModel(string BM) { DataTable bMXZQY = this.bmkhDAL.GetBMXZQY(BM); BMXZQYModel model = new BMXZQYModel(); if (bMXZQY.Rows.Count > 0) { DataRow row = bMXZQY.Rows[0]; model.BM = GetSafeData.ValidateValue <string>(row, "BM"); model.MC = GetSafeData.ValidateValue <string>(row, "MC"); } return(model); }
public void checkspspfl() { DataTable table = new DAL.BMSPManager().QuerySPSPFLLNotEmptyAndNotXT(); if (table != null) { DAL.BMSPFLManager manager2 = new DAL.BMSPFLManager(); List <string> sqlID = new List <string>(); List <Dictionary <string, object> > param = new List <Dictionary <string, object> >(); for (int i = 0; i < table.Rows.Count; i++) { Dictionary <string, object> item = new Dictionary <string, object>(); string str = GetSafeData.ValidateValue <string>(table.Rows[i], "BM"); string bm = GetSafeData.ValidateValue <string>(table.Rows[i], "SPFL"); string str3 = GetSafeData.ValidateValue <string>(table.Rows[i], "LSLVBS"); string str4 = GetSafeData.ValidateValue <string>(table.Rows[i], "YHZC"); string str5 = GetSafeData.ValidateValue <string>(table.Rows[i], "YHZCMC"); string sPFLMCBYBM = string.Empty; item.Add("BM", str); if (manager2.CanUseThisSPFLBM(bm, true, false)) { item.Add("SPFL", bm); sPFLMCBYBM = manager2.GetSPFLMCBYBM(bm); item.Add("SPFLMC", sPFLMCBYBM); if (manager2.CanUseThisYHZC(bm)) { item.Add("YHZC", str4); item.Add("YHZCMC", str5); item.Add("LSLVBS", str3); } else { item.Add("YHZC", "否"); item.Add("YHZCMC", ""); item.Add("LSLVBS", ""); } } else { item.Add("SPFL", ""); item.Add("SPFLMC", ""); item.Add("YHZC", ""); item.Add("YHZCMC", ""); item.Add("LSLVBS", ""); } sqlID.Add("aisino.Fwkp.Bmgl.BMSPFL.UpdateSPSPFL"); param.Add(item); } new DAL.BMSPFLManager().UpdateSPFLTable(sqlID, param, false); } }
/// <summary> /// 设置考核结果 /// </summary> /// <param name="dtSchedule">考核结果信息</param> private void InitAsseResultInfo(DataTable dtResult) { //定义保存进度安排的变量 StringBuilder sbResultInfo = new StringBuilder(); //换行标识 int flag = 0; //进度安排存在时,设置进度安排 if (dtResult != null && dtResult.Rows.Count > 0) { for (int i = 0; i < dtResult.Rows.Count; i++) { /* 每行显示两条数据,所以通过对2取余来判断是否换行 以及 行是否结束 */ //对2进行取余 flag = i % 2; //余数为0时,表示需要新添加一行 if (flag == 0) { //插入行开始标识 sbResultInfo.AppendLine("<tr>"); } //姓名 sbResultInfo.AppendLine("<td class='tdColInputCenter'><input type='hidden' value='" + GetSafeData.ValidateDataRow_String(dtResult.Rows[i], "EmployeeID") + "' class='tdinput' id='txtJoinUserID_" + i.ToString() + "'>" + GetSafeData.ValidateDataRow_String(dtResult.Rows[i], "EmployeeName") + "</td>"); //考核得分 sbResultInfo.AppendLine("<td class='tdColInput'><input type='text' maxlength = '6' onchange='Number_round(this,2);' value='" + GetSafeData.ValidateDataRow_String(dtResult.Rows[i], "AssessScore") + "' class='tdinput' id='txtAsseScore_" + i.ToString() + "'></td>"); //考核等级 sbResultInfo.AppendLine("<td class='tdColInputCenter'>" + InitLevelDropDownList("ddlAsseLevel_" + i.ToString(), GetSafeData.ValidateDataRow_String(dtResult.Rows[i], "AssessLevel")) + "</td>"); //余数为1时,表示行结束 if (flag == 1) { //插入行结束标识 sbResultInfo.AppendLine("</tr>"); } } //余数为0时,表示所有的记录为单数条,因此需要把未结束的行结束 if (flag == 0) { //插入空白列 sbResultInfo.AppendLine("<td class='tdColInputCenter'></td><td class='tdColInput'></td><td class='tdColInputCenter'></td>"); //插入行结束标识 sbResultInfo.AppendLine("</tr>"); } } //考核结果设置到DIV中表示 divRsseResultDetail.InnerHtml = CreateResultTable() + sbResultInfo.ToString() + EndTable(); }
/// <summary> /// 根据编码规则获取单据编号 /// </summary> /// <param name="codeID">编码规则ID</param> /// <returns></returns> public static string GetCodeValue(string codeID) { //上次生成的最大流水号 //int lastpreNo =-1; //定义返回的值 string codeValue = ""; //获取编码规则详细设置内容 DataTable ruleData = ItemCodingRuleDBHelper.GetCodingRuleInfoWithID(codeID); //数据存在时进行Code生成操作 if (ruleData != null && ruleData.Rows.Count > 0) { //获取编码示例 string ruleExample = GetSafeData.ValidateDataRow_String(ruleData.Rows[0], "RuleExample"); //编码示例长度小于4时,进行设置 if (!string.IsNullOrEmpty(ruleExample) && ruleExample.Length > 4) { //获取流水号类型 int start = ruleExample.LastIndexOf(ConstUtil.RULE_EXAMPLE_START); string ruleNoType = ruleExample.Substring(start); //获取当前流水号最大值 string lastNo = GetSafeData.ValidateDataRow_Int(ruleData.Rows[0], "LastNo").ToString(); //编码流水号长度 int ruleNoLen = GetSafeData.ValidateDataRow_Int(ruleData.Rows[0], "RuleNoLen"); //长度不够时左边添加0 lastNo = lastNo.PadLeft(ruleNoLen, ConstUtil.RULE_EXAMPLE_ZERO); //替换流水号 codeValue = ruleExample.Replace(ruleNoType, lastNo); //获取编码类型 string codingType = GetSafeData.ValidateDataRow_String(ruleData.Rows[0], "CodingType"); //编码类型为单据时,替换日期设置 if (!ConstUtil.CODING_RULE_TYPE_ZERO.Equals(codingType)) { //获取流水号类型 start = ruleExample.IndexOf(ConstUtil.RULE_EXAMPLE_START); int end = ruleExample.IndexOf(ConstUtil.RULE_EXAMPLE_END); string dateType = ruleExample.Substring(start, end - start + 1); //获取当前日期值 string dateTypeValue = DateTime.Now.ToString(dateType.Substring(1, dateType.Length - 2)); //替换日期类型 codeValue = codeValue.Replace(dateType, dateTypeValue); } } } //返回生成的单据编号 return(codeValue); }