public string getConnStr(Model.Synergismlogdt dt) { DAL.Regist rdal = new Regist(); Model.Regist rmdoel = rdal.GetModel(dt.Accid); if (rmdoel != null) { return(string.Format("Data Source={0};Initial Catalog={1};Persist Security Info=True;User ID=sa;Password={2};Current Language=Simplified Chinese", rmdoel.Caddress, rmdoel.Caccname, rmdoel.Cdbpwd)); } else { return(""); } }
public Model.ConnectInfo getConnectStr(Model.Synergismlogdt dt) { DAL.Regist rdal = new Regist(); Model.Regist rmdoel = rdal.GetModel(dt.Accid); if (rmdoel != null) { Model.ConnectInfo cimodel = new Model.ConnectInfo(); cimodel.AccId = rmdoel.Cacc_id; cimodel.Source = rmdoel.Datasource; cimodel.Password = rmdoel.Cpassword; cimodel.Srv = rmdoel.Caddress; //应用服务器 add by wangdd cimodel.sSrv = rmdoel.Cservername; cimodel.SubId = "DP"; //测试 cimodel.UserId = rmdoel.Cuser_id; cimodel.YearId = rmdoel.Ibeginyear.ToString(); cimodel.Serial = ApiService.BLL.Common.GetSerial(); cimodel.BEnable = rmdoel.Benable == "1" || rmdoel.Benable == "是"; cimodel.Constring = string.Format("Data Source={0};Initial Catalog={1};Persist Security Info=True;User ID=sa;Password={2};Current Language=Simplified Chinese", rmdoel.Caddress, rmdoel.Caccname, rmdoel.Cdbpwd); return(cimodel); } return(null); }