/// <summary> /// 查询出所有的数据 /// </summary> /// <returns>返回数据源</returns> public static DataSet BillPrint(string Code,string TableName) { string retSql = ""; DataBase db = new DataBase(); DataBaseVisitor visitor = new BillInfoDAL(); DataSet ds = new DataSet(); try { ds = db.ReturnDataSet(BillInfoSql(Code), TableName); //在程序中表示的名字给Capion int i=0; foreach (DataRow row in BillInfoColName().Tables[0].Rows) { ds.Tables[TableName].Columns[i].Caption = row[0].ToString().Trim(); i++; } } catch (Exception ex) { throw ex; } finally { db.Dispose(); } return ds; }
/// <summary> /// 用户登陆 /// </summary> /// <param name="Item">model</param> /// <returns></returns> public static bool UserLogin(D_User Item) { DataBase db = new DataBase(); DataBaseVisitor visitor = new UsersDAL(); bool Flag = false; SqlParameter[] prams ={ db.MakeInParam("@Uid",SqlDbType.VarChar,50,Item.Uid), db.MakeInParam("@Pwd",SqlDbType.VarChar,50,Item.Pwd) }; try { DataSet ds = new DataSet(); ds = db.ReturnDataSet(visitor, prams, "UserLogin"); DataRowCollection drc = ds.Tables[0].Rows; if (drc.Count > 0) { DataRow dr = drc[0]; CUser.Id = Convert.ToInt64(dr["Id"]); CUser.Code = dr["Code"].ToString(); CUser.Uid = dr["Uid"].ToString(); CUser.Name = dr["Name"].ToString(); CUser.Role = dr["Role"].ToString(); //PublicFun.IniFile Ini = new PublicFun.IniFile(WSV.Model.FilePath.Config); //if (Ini.ExistIniFile()) //{ // LUser.TableNum = Ini.IniReadValue("LoadoMeter", "TableNum"); //} //ds = WSV.BLL.SysInfo.LoadoMeterBLL.SelectAll(" where TableNum='" + LUser.TableNum + "'"); //drc = ds.Tables[0].Rows; //if (drc.Count > 0) //{ // dr = drc[0]; // LUser.TableName = dr["Name"].ToString(); // LUser.Ip = dr["Ip"].ToString(); // LUser.Port = dr["Port"].ToString(); //} //else //{ // LUser.TableNum = ""; //} Flag = true; } } catch (Exception ex) { throw ex; } finally { db.Dispose(); } return Flag; }
/// <summary> /// ���� /// </summary> /// <returns></returns> public static DataSet SaverInfo(string sql) { DataBase db = new DataBase(); DataSet ds = new DataSet(); try { ds = db.ReturnDataSet(sql); } catch (Exception ex) { throw new Exception(ex.Message); } finally { db.Dispose(); } return ds; }
/// <summary> /// �������ʱģ����ѯ /// </summary> /// <param name="s_Pr"></param> /// <param name="s_pr1"></param> /// <returns></returns> public static DataSet SelectData(string s_pr) { DataBase db = new DataBase(); string sql = "select Plan_Code,Plan_Item,Plan_Specs,Plan_Send,Plan_Accept from V_DC_Plan where Plan_Code like '%" + s_pr + "%' and Plan_Used = 0"; DataSet ds = new DataSet(); try { ds = db.ReturnDataSet(sql); } catch (Exception ex) { throw new Exception(ex.Message); } finally { db.Dispose(); } return ds; }
/// <summary> /// 查询出所有的数据 /// </summary> /// <returns></returns> public static DataSet SelectAll() { DataBase db = new DataBase(); DataBaseVisitor visitor = new DC_BaseVisitor(); DataSet ds = new DataSet(); try { ds = db.ReturnDataSet(visitor, "Select", "V_DC_Base"); } catch (Exception ex) { throw new Exception(ex.Message); } finally { db.Dispose(); } return ds; }
/// <summary> /// 查询出所有的数据 /// </summary> /// <returns>DataSet</returns> public static DataSet BindItem() { DataBase db = new DataBase(); DAL.DataBaseVisitor visitor = new DAL.Record.D_CubetyVisitor(); DataSet ds = new DataSet(); try { ds = db.ReturnDataSet(visitor, "BingdItem", "D_Base"); } catch (Exception ex) { throw new Exception(ex.Message); } finally { db.Dispose(); } return ds; }
public static DataSet GetName() { DataBase db = new DataBase(); DataSet ds = new DataSet(); string sql = "select Name,DBName from V_C_Select where Show=1"; try { ds = db.ReturnDataSet(sql); } catch (Exception ex) { throw new Exception(ex.Message); } finally { db.Dispose(); } return ds; }
/// <summary> /// 带参数的数据查询 /// </summary> /// <param name="Begin">开始时间</param> /// <param name="Over">结束时间</param> /// <param name="Name">操作方式</param> /// <returns>DataSet</returns> public static DataSet SelectByWorkWise(string Begin, string Over, string Name) { string sql2 = Sql() + " where WorkName='" + Name + "' and DT between '" + Begin + "' and '" + Over + "' order by ID desc"; DataBase db = new DataBase(); DataBaseVisitor visitor = new WSV.DAL.MyLog.Modify(); DataSet ds = new DataSet(); try { ds = db.ReturnDataSet(sql2); } catch (Exception ex) { throw new Exception(ex.Message); } finally { db.Dispose(); } return ds; }
/// <summary> /// 得到列名 /// </summary> public static DataSet BillInfoColName() { DataBase db = new DataBase(); DataBaseVisitor visitor = new BillInfoDAL(); DataSet ds = new DataSet(); try { ds = db.ReturnDataSet(visitor, "BillInfoColName", "A"); } catch (Exception ex) { throw ex; } finally { db.Dispose(); } return ds; }
/// <summary> /// 查询出所有的数据 /// </summary> /// <returns>返回数据源</returns> public static DataSet SelectAll() { DataBase db = new DataBase(); DataBaseVisitor visitor = new WeightDAL(); DataSet ds = new DataSet(); try { ds = db.ReturnDataSet(visitor, "Select", "C_Weight"); } catch (Exception ex) { throw ex; } finally { db.Dispose(); } return ds; }
/// <summary> /// ��ʾ��ʱ���� /// </summary> /// <returns></returns> public static DataSet SelectALL() { DataBase db = new DataBase(); DataBaseVisitor visitor = new WSV.DAL.Weight.PlanDAL(); DataSet ds = new DataSet(); try { ds = db.ReturnDataSet(visitor, "SelectALL", "V_DC_Plan"); } catch (Exception ex) { throw new Exception(ex.Message); } finally { db.Dispose(); } return ds; }
/// <summary> /// ��ѯ������Ӧ�Ļ�����Ŀ /// </summary> /// <returns></returns> public static DataSet SelectCode(string Code) { DataBase db = new DataBase(); DataBaseVisitor visitor = new CountDal(); DataSet ds = new DataSet(); SqlParameter[] prams ={ db.MakeInParam("@Code", SqlDbType.VarChar,50, Code), }; try { ds = db.ReturnDataSet(visitor, prams, "SelectCode"); } catch (Exception ex) { throw new Exception(ex.Message); } finally { db.Dispose(); } return ds; }
/// <summary> /// 带参数的数据查询 /// </summary> /// <param name="Begin">开始时间</param> /// <param name="Over">结束时间</param> /// <returns>DataSet</returns> public static DataSet SelectAll(string Begin, string Over) { DataBase db = new DataBase(); DataBaseVisitor visitor = new WSV.DAL.MyLog.DL_WeightVisitor(); DataSet ds = new DataSet(); SqlParameter[] prams ={ db.MakeInParam("@Begin", SqlDbType.Char,50, Begin), db.MakeInParam("@Over", SqlDbType.Char,50, Over), }; try { ds = db.ReturnDataSet(visitor, prams, "Select"); } catch (Exception ex) { throw new Exception(ex.Message); } finally { db.Dispose(); } return ds; }
/// <summary> /// �������ʱģ����ѯ /// </summary> /// <param name="s_Pr"></param> /// <param name="s_pr1"></param> /// <returns></returns> public static DataSet SelectData(string s_Pr, string s_pr1, int PortId2) { DataBase db = new DataBase(); string sql = "select Code,Name from V_D_Base where Flag='" + s_Pr + "' and PortId2='" + PortId2 + "' and Rem+Name+Code like '%" + s_pr1 + "%'"; DataSet ds = new DataSet(); try { ds = db.ReturnDataSet(sql); } catch (Exception ex) { throw new Exception(ex.Message); } finally { db.Dispose(); } return ds; }
/// <summary> /// ���ݲ��� /// </summary> /// <param name="s_Pr"></param> /// <returns></returns> public static DataSet Data_Operate(string s_Pr) { DataBase db = new DataBase(); DataBaseVisitor visitor = new WSV.DAL.Weight.WeightDAL(); SqlParameter[] prams ={ db.MakeInParam("@Flag", SqlDbType.VarChar,50,s_Pr) }; DataSet ds = new DataSet(); try { ds = db.ReturnDataSet(visitor, prams, "D_Operate", "V_D_Base"); } catch (Exception ex) { throw new Exception(ex.Message); } finally { db.Dispose(); } return ds; }
/// <summary> /// ��ѯ���ݸ�ʽ /// </summary> /// <param name="ProCode"></param> public static DataSet Selectfun() { DataBase db = new DataBase(); DataBaseVisitor visitor = new CountDal(); DataSet ds = new DataSet(); try { ds = db.ReturnDataSet(visitor, "Selectfun", "C_Function"); } catch (Exception ex) { throw new Exception(ex.Message); } finally { db.Dispose(); } return ds; }
/// <summary> /// 查询出所有的数据 /// </summary> /// <returns>返回数据源</returns> public static DataSet SelectAll(string WhereSql) { DataBase db = new DataBase(); DataBaseVisitor visitor = new PowerDAL(); DataSet ds = new DataSet(); try { ds = db.ReturnDataSet(visitor, "Select", "DC_Power",WhereSql); } catch (Exception ex) { throw ex; } finally { db.Dispose(); } return ds; }
public static DataSet SelectMain() { DataBase db = new DataBase(); DataBaseVisitor visitor = new WSV.DAL.MyLog.Modify(); DataSet ds = new DataSet(); try { ds = db.ReturnDataSet(visitor, "SelMain", "LC_Main"); } catch (Exception ex) { throw new Exception(ex.Message); } finally { db.Dispose(); } return ds; }
/// <summary> /// 按条件查询数据 /// </summary> /// <param name="PCode">父类编号-DC_Base编号</param> /// <param name="used">是否作废</param> /// <returns>DataSet</returns> public static DataSet SelectByPCode(string PCode, bool used) { DataBase db = new DataBase(); DataBaseVisitor visitor = new D_BaseVisitor(); DataSet ds = new DataSet(); SqlParameter[] prams ={ db.MakeInParam("@ParentCode", SqlDbType.VarChar,50, PCode), }; try { if (used) //查询没作废的信息 { ds = db.ReturnDataSet(visitor, prams, "Select_Use"); } else //查询作废的信息 { ds = db.ReturnDataSet(visitor, prams, "Select_Used"); } } catch (Exception ex) { throw new Exception(ex.Message); } finally { db.Dispose(); } return ds; }
/// <summary> /// 根据类型得到打印的文件和标题 /// </summary> /// <returns></returns> public static DataSet PrintParam(string Type) { DataBase db = new DataBase(); DataBaseVisitor visitor = new BillInfoDAL(); SqlParameter[] prams ={ db.MakeInParam("@TypeName", SqlDbType.VarChar,50,Type) }; DataSet ds = new DataSet(); try { ds = db.ReturnDataSet(visitor,prams, "PrintParam"); } catch (Exception ex) { throw ex; } finally { db.Dispose(); } return ds; }
public static DataSet SelectDBName() { DataBase db = new DataBase(); string sql = "select DBName from C_Alias where State = 1"; DataSet ds = new DataSet(); try { ds = db.ReturnDataSet(sql); } catch (Exception ex) { throw new Exception(ex.Message); } finally { db.Dispose(); } return ds; }
/// <summary> /// 查询计算方式 /// </summary> /// <returns>DataSet</returns> public static DataSet SelectCountWay() { DataBase db = new DataBase(); DataBaseVisitor visitor = new DAL.Plan.PlanVisitor(); DataSet ds = new DataSet(); try { ds = db.ReturnDataSet(visitor, "Select_CountWay", "D_CountWay"); } catch (Exception ex) { throw new Exception(ex.Message); } finally { db.Dispose(); } return ds; }
/// <summary> /// 查询类型表 /// </summary> /// <returns></returns> public static DataSet SelectType() { DataBase db = new DataBase(); DataBaseVisitor visitor = new WSV.DAL.MyLog.OperData(); DataSet ds = new DataSet(); try { ds = db.ReturnDataSet(visitor, "SelType", "D_Type"); } catch (Exception ex) { throw new Exception(ex.Message); } finally { db.Dispose(); } return ds; }
/// <summary> /// 按条件查询数据 /// </summary> /// <param name="used">是否启用</param> /// <returns>DataSet</returns> public static DataSet SelectByPCode(bool used) { DataBase db = new DataBase(); DataBaseVisitor visitor = new D_CarCodeVisitor(); DataSet ds = new DataSet(); try { if (used) //查询没作废的信息 { ds = db.ReturnDataSet(visitor, "Select_Use", "D_CarCode"); } else //查询作废的信息 { ds = db.ReturnDataSet(visitor, "Select_Used", "D_CarCode"); } } catch (Exception ex) { throw new Exception(ex.Message); } finally { db.Dispose(); } return ds; }