Exemple #1
0
        /// <summary>
        /// 获取当前任务的数据库连接串
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public Model.ConnectInfo GetConnectInfo(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    = 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);
                cimodel.Date      = BLL.Common.GetVerifyData(dt);
                if (cimodel.Date == DateTime.Now.ToString("yyyy-MM-dd"))
                {
                    cimodel.Date = BLL.Common.GetLoginDate(rmdoel);
                }

                return(cimodel);
            }
            return(null);
        }
Exemple #2
0
 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("");
     }
 }