Esempio n. 1
0
        protected override void OnInit(EventArgs e)
        {
            try
            {
                var superKey   = "";
                var setId      = 0;
                var key        = 0;
                var clientdata = new ClientDataModel();
                var results    = ClientDataManager.Search(clientdata, SessionVariables.RequestProfile).Clone();

                if (Request.QueryString["SuperKey"] != null)
                {
                    superKey = Request.QueryString["SuperKey"];
                }
                else if (Request.QueryString["SetId"] != null)
                {
                    setId = int.Parse(Request.QueryString["SetId"]);
                }
                if (int.Parse(superKey) > 0)
                {
                    var data = new SuperKeyDetailDataModel();
                    data.SuperKeyId = Convert.ToInt32(superKey);

                    // Change System Entity Type
                    data.SystemEntityTypeId = (int)SystemEntity.Client;
                    var dt = SuperKeyDetailDataManager.Search(data, SessionVariables.RequestProfile);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            key = (int)(dr[SuperKeyDetailDataModel.DataColumns.EntityKey]);
                            clientdata.ClientId = key;
                            var clientdt = ClientDataManager.Search(clientdata, SessionVariables.RequestProfile);
                            if (clientdt.Rows.Count == 1)
                            {
                                results.ImportRow(clientdt.Rows[0]);
                            }
                        }
                    }
                }
                else
                {
                    key = setId;
                    clientdata.ClientId = key;
                    var clientdt = ClientDataManager.Search(clientdata, SessionVariables.RequestProfile);
                    if (clientdt.Rows.Count > 1)
                    {
                        results.ImportRow(clientdt.Rows[0]);
                    }
                }
                SelectedData = new DataTable();
                SelectedData = results.Copy();
                base.OnInit(e);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                //throw
            }
        }
Esempio n. 2
0
        protected override DataTable GetEntityData(int?entityKey)
        {
            var clientData = new ClientDataModel();

            clientData.ClientId = entityKey;
            var results = ClientDataManager.Search(clientData, SessionVariables.RequestProfile);

            return(results);
        }
Esempio n. 3
0
        private DataTable GetData()
        {
            // TODO: on all export pages
            var data = new ClientDataModel();

            var dt = ClientDataManager.Search(data, SessionVariables.RequestProfile);

            return(dt);
        }
Esempio n. 4
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            var updatedData = new DataTable();
            var data        = new ClientDataModel();

            updatedData = ClientDataManager.Search(data, SessionVariables.RequestProfile).Clone();

            for (var i = 0; i < SelectedData.Rows.Count; i++)
            {
                data.ClientId = Convert.ToInt32(SelectedData.Rows[i][ClientDataModel.DataColumns.ClientId].ToString());
                if (IsNameSelected)
                {
                    data.Name = Name;
                }
                else
                {
                    data.Name = SelectedData.Rows[i][StandardDataModel.StandardDataColumns.Name].ToString();
                }

                if (IsDescriptionSelected)
                {
                    data.Description = Description;
                }
                else
                {
                    data.Description = SelectedData.Rows[i][StandardDataModel.StandardDataColumns.Description].ToString();
                }

                if (IsSortOrderSelected)
                {
                    data.SortOrder = SortOrder;
                }
                else
                {
                    data.SortOrder = Convert.ToInt32(SelectedData.Rows[i][StandardDataModel.StandardDataColumns.SortOrder].ToString());
                }


                ClientDataManager.Update(data, SessionVariables.RequestProfile);

                data          = new ClientDataModel();
                data.ClientId = Convert.ToInt32(SelectedData.Rows[i][ClientDataModel.DataColumns.ClientId].ToString());
                var dt = ClientDataManager.Search(data, SessionVariables.RequestProfile);

                if (dt.Rows.Count == 1)
                {
                    updatedData.ImportRow(dt.Rows[0]);
                }

                // if everything is done and good THEN move from thsi page.
                //Response.Redirect("Default.aspx?Added=" + true, false);
            }

            MainGridView.DataSource = updatedData;
            MainGridView.DataBind();
        }
Esempio n. 5
0
        protected override DataTable UpdateData()
        {
            var UpdatedData = new DataTable();

            var data = new ClientDataModel();

            UpdatedData = ClientDataManager.Search(data, SessionVariables.RequestProfile).Clone();

            for (var i = 0; i < SelectedData.Rows.Count; i++)
            {
                data.ClientId =
                    Convert.ToInt32(SelectedData.Rows[i][ClientDataModel.DataColumns.ClientId].ToString());

                data.Name = SelectedData.Rows[i][StandardDataModel.StandardDataColumns.Name].ToString();

                data.Description =
                    !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.Description))
                                        ? CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.Description)
                                        : SelectedData.Rows[i][StandardDataModel.StandardDataColumns.Description].ToString();

                data.SortOrder =
                    !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.SortOrder))
                                        ? int.Parse(CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.SortOrder))
                                        : int.Parse(SelectedData.Rows[i][StandardDataModel.StandardDataColumns.SortOrder].ToString());

                ClientDataManager.Update(data, SessionVariables.RequestProfile);
                data = new ClientDataModel();

                data.ClientId = Convert.ToInt32(SelectedData.Rows[i][ClientDataModel.DataColumns.ClientId].ToString());

                var dt = ClientDataManager.Search(data, SessionVariables.RequestProfile);

                if (dt.Rows.Count == 1)
                {
                    UpdatedData.ImportRow(dt.Rows[0]);
                }
            }

            return(UpdatedData);
        }
Esempio n. 6
0
        protected override DataTable GetData()
        {
            var dt = ClientDataManager.Search(oSearchFilter.SearchParameters, SessionVariables.RequestProfile);

            return(dt);
        }
Esempio n. 7
0
 private void ReBindEditableGrid()
 {
     var data     = new ClientDataModel();
     var dtClient = ClientDataManager.Search(data, SessionVariables.RequestProfile);
     //eList1.BindData(dtClient);
 }