Exemplo n.º 1
0
        public static DataTable Search(ProjectDataModel data, RequestProfile requestProfile)
        {
            var list = GetEntityDetails(data, requestProfile, 0);

            return(list.ToDataTable());
        }
Exemplo n.º 2
0
 public void InsertProject(ProjectDataModel project)
 {
     //TODO
 }
Exemplo n.º 3
0
        public static ProjectDataModel GetDetails(ProjectDataModel data, RequestProfile requestProfile)
        {
            var list = GetEntityDetails(data, requestProfile, 0);

            return(list.FirstOrDefault());
        }
Exemplo n.º 4
0
        public static void Update(ProjectDataModel data, RequestProfile requestProfile)
        {
            var sql = Save(data, "Update", requestProfile);

            DBDML.RunSQL("Project.Update", sql, DataStoreKey);
        }
Exemplo n.º 5
0
        protected override void OnInit(EventArgs e)
        {
            try
            {
                var superKey      = "";
                var newId         = SystemEntityTypeDataManager.GetNextSequence("Project", (int)SystemEntity.Project, SessionVariables.RequestProfile);
                var Projectdata   = new ProjectDataModel();
                var systemdevdata = new SystemDevNumbersDataModel();
                systemdevdata.ApplicationUserId = SessionVariables.RequestProfile.AuditId;
                var dtnumbers = SystemDevNumbersDataManager.Search(systemdevdata, SessionVariables.RequestProfile);
                var rangefrom =
                    Convert.ToInt32(dtnumbers.Rows[0][SystemDevNumbersDataModel.DataColumns.RangeFrom].ToString());
                var rangeto =
                    Convert.ToInt32(dtnumbers.Rows[0][SystemDevNumbersDataModel.DataColumns.RangeTo].ToString());
                if (Request.QueryString["SuperKey"] != null)
                {
                    superKey = Request.QueryString["SuperKey"].ToString();
                    var data = new SuperKeyDetailDataModel();
                    data.SuperKeyId         = Convert.ToInt32(superKey);
                    data.SystemEntityTypeId = (int)SystemEntity.Project;
                    var dt = SuperKeyDetailDataManager.Search(data, SessionVariables.RequestProfile);

                    if (dt != null && dt.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            var key = Convert.ToInt32(dr[SuperKeyDetailDataModel.DataColumns.EntityKey]);
                            Projectdata.ProjectId = key;

                            var Projectdt = ProjectDataManager.GetDetails(Projectdata, SessionVariables.RequestProfile);

                            if (Projectdt.Rows.Count == 1)
                            {
                                var row = Projectdt.Rows[0];

                                if (Request.QueryString["Mode"].ToString().Equals("Test"))
                                {
                                    Projectdata.ProjectId = GetNextValidId(rangefrom);
                                }
                                Projectdata.Name        = Convert.ToString(row[StandardDataModel.StandardDataColumns.Name]);
                                Projectdata.Description = Convert.ToString(row[StandardDataModel.StandardDataColumns.Description]);
                                Projectdata.SortOrder   = Convert.ToInt32(row[StandardDataModel.StandardDataColumns.SortOrder]);

                                ProjectDataManager.Create(Projectdata, SessionVariables.RequestProfile);
                            }
                        }
                    }
                }
                else if (Request.QueryString["SetId"] != null)
                {
                    var key = int.Parse(Request.QueryString["SetId"]);
                    Projectdata.ProjectId = key;

                    var Projectdt = ProjectDataManager.GetDetails(Projectdata, SessionVariables.RequestProfile);

                    if (Projectdt.Rows.Count == 1)
                    {
                        var row = Projectdt.Rows[0];

                        var newProjectdata = new ProjectDataModel();
                        if (Request.QueryString["Mode"].ToString().Equals("Test"))
                        {
                            newProjectdata.ProjectId = newId = (int)GetNextValidId(rangefrom);
                        }
                        newProjectdata.Name        = Convert.ToString(row[StandardDataModel.StandardDataColumns.Name]);
                        newProjectdata.Description = Convert.ToString(row[StandardDataModel.StandardDataColumns.Description]);
                        newProjectdata.SortOrder   = Convert.ToInt32(row[StandardDataModel.StandardDataColumns.SortOrder]);

                        UpdatedFKDepenedencies(key, newId);
                        ProjectDataManager.Delete(Projectdata, SessionVariables.RequestProfile);
                        ProjectDataManager.Create(newProjectdata, SessionVariables.RequestProfile);
                    }
                }
                else if (Request.QueryString["Mode"].ToString().Equals("Renumber"))
                {
                    var seed = int.Parse(Request.QueryString["Seed"].ToString());
                    //ApplicationVariables.Seed;
                    var increment = int.Parse(Request.QueryString["Increment"].ToString());
                    //ApplicationVariables.Increment;
                    ProjectDataManager.Renumber(seed, increment, SessionVariables.RequestProfile);
                }
                base.OnInit(e);

                Response.Redirect("Default.aspx?Added=true", false);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
Exemplo n.º 6
0
 private void ReBindEditableGrid()
 {
     var data      = new ProjectDataModel();
     var dtProject = ProjectDataManager.Search(data, SessionVariables.RequestProfile);
 }
Exemplo n.º 7
0
        public void SetData(ProjectDataModel item)
        {
            SystemKeyId = item.ProjectId;

            base.SetData(item);
        }
Exemplo n.º 8
0
        public void SetData(ProjectDataModel data)
        {
            SystemKeyId = data.ProjectId;

            base.SetData(data);
        }
Exemplo n.º 9
0
 private models.Project parse(ProjectDataModel dataModel)
 {
     return(new models.Project(dataModel.Id, dataModel.Name, dataModel.Description, "", dataModel.Budget, models.Project.ProjectStatus.COMPLETED));
 }