private void InsertGroup(DataTable dtGroup)
        {
            foreach (DataRow row in dtGroup.Rows)
            {
                string strId         = row["Index"].ToString();
                string strName       = row["Name"].ToString();
                string strManager    = row["ManagerName"].ToString();
                string strManagerTel = row["ManagerTel"].ToString();
                string strAddress    = row["Address"].ToString();
                string strRefOrg     = row["RefOrgName"].ToString();

                if (GroupBll.IsNameExist(strName))
                {
                    continue;
                }

                GlareSysEfDbAndModels.GroupInfo group = new GlareSysEfDbAndModels.GroupInfo()
                {
                    CreateDt     = DateTime.Now,
                    Id           = 0,
                    IsDel        = 0,
                    ManageName   = strManager,
                    ManageTel    = strManagerTel,
                    UpdateDt     = DateTime.Now,
                    GroupAddress = strAddress,
                    GroupName    = strName,
                    OrgId        = DataLoader.GetOrgIDByOrgName(strRefOrg)
                };
                string strError;
                GroupBll.AddAGroup(ref group, out strError);
            }
        }
        private void InsertProject(DataTable dtProject)
        {
            foreach (DataRow row in dtProject.Rows)
            {
                string strId           = row["Index"].ToString();
                string strName         = row["Name"].ToString();
                string strManager      = row["ManagerName"].ToString();
                string strManagerTel   = row["ManagerTel"].ToString();
                string strAddress      = row["Address"].ToString();
                string strRefGroupName = row["RefGroupName"].ToString();

                if (GroupBll.IsNameExist(strName))
                {
                    continue;
                }

                GlareSysEfDbAndModels.ProjectInfo project = new GlareSysEfDbAndModels.ProjectInfo()
                {
                    Address     = strAddress,
                    CreateDt    = DateTime.Now,
                    Id          = 0,
                    IsDel       = 0,
                    UpdateDt    = DateTime.Now,
                    GroupId     = DataLoader.GetProjectIDByProjectName(strRefGroupName),
                    ManagerName = strManager,
                    ManagerTel  = strManagerTel,
                    OrgId       = DataLoader.GetOrgIDByProjectName(strRefGroupName),
                    ProjectName = strName
                };
                string strError;
                ProjectBll.AddAProject(ref project, out strError);
            }
        }
示例#3
0
        private void InsertProject(DataTable dtProject)
        {
            foreach (DataRow row in dtProject.Rows)
            {
                string strId         = row["Index"].ToString();
                string strName       = row["Name"].ToString();
                string strManager    = row["ManagerName"].ToString();
                string strManagerTel = row["ManagerTel"].ToString();
                string strAddress    = row["Address"].ToString();
                string strRefOrg     = row["RefGroupName"].ToString();

                if (GroupBll.IsNameExist(strName))
                {
                    continue;
                }

                GlareSysEfDbAndModels.OrgInfo org = new GlareSysEfDbAndModels.OrgInfo()
                {
                    Address    = strAddress,
                    CreateDt   = DateTime.Now,
                    Id         = 0,
                    IsDel      = 0,
                    ManageName = strManager,
                    ManageTel  = strManagerTel,
                    Name       = strName,
                    UpdateDt   = DateTime.Now
                };
                string strError;
                OrgBll.AddAOrg(ref org, out strError);
            }

            MemCfgInfo.MemDbMgr.Get().Load();
        }