protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            if (Request.QueryString["action"] != null)
            {
                if (Request.QueryString["action"].ToLower().CompareTo("delete") == 0)
                {
                    int CurrentId = this.OrganizationID;

                    DL_WEB.DAL.Master.Organization oOrganization = new DL_WEB.DAL.Master.Organization();
                    oOrganization.LoadByPrimaryKey(CurrentId);

                    string CurrentName = oOrganization.Name;

                    oOrganization.IsDeleted = true;
                    oOrganization.Save();

                    DL_WEB.DAL.Client.ActivityLog.Instance.RegisterActivity(ActivityTypes.OrganizationDeleted, "Organization " + CurrentName + " deleted", ActivityObject.Organization, CurrentId, this.UserGUID, Context.User.Identity.Name);
                }
            }
        }

        DL_DAL.Master.OrganizationView oOrganizationView = new DL_DAL.Master.OrganizationView();
        oOrganizationView.ConnectionString         = DL_WEB.DAL.Master.Master.DBConnectionString;
        oOrganizationView.Where.IsDeleted.Value    = false;
        oOrganizationView.Where.IsDeleted.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
        oOrganizationView.Query.Load();

        OrganizationList.DataSource = oOrganizationView.DefaultView;
        OrganizationList.DataBind();
    }
Exemplo n.º 2
0
        protected void LoginButton_Click(object sender, EventArgs e)
        {
            try
            {
                DataTable dt = Client.GetOrganizations(WarehouseLoginTextBox.Text, WarehousePasswordTextBox.Text);
                if (dt.Rows.Count > 0)
                {
                    WarehouseLoginPanel.Visible = false;
                    ConnectPanel.Visible        = true;
                    OrganizationList.DataSource = dt;
                    OrganizationList.DataBind();
                    OrganizationList.SelectedIndex = 0;

                    dt = Client.GetInstances(new Guid(OrganizationList.SelectedValue));
                    if (dt.Rows.Count > 0)
                    {
                        InstanceList.DataSource = dt;
                        InstanceList.DataBind();
                    }
                }
            }
            catch
            {
                errorLabel.Visible = true;
            }
        }
Exemplo n.º 3
0
    public void FetchOrganizationListData()
    {
        GlobalClass gClass = new GlobalClass();

        System.Data.SqlClient.SqlCommand cmdSelect = new System.Data.SqlClient.SqlCommand();

        gClass.MakeStoreProcedureName(ref cmdSelect, "sp_Organization_LoadData", false);
        cmdSelect.Parameters.Add("@strOrganizationCode", System.Data.SqlDbType.VarChar, 10).Value = String.Empty;

        OrganizationList.DataSource     = gClass.FetchData(cmdSelect, "tblOrganization");
        OrganizationList.DataMember     = "tblOrganization";
        OrganizationList.DataValueField = "Code";
        OrganizationList.DataTextField  = "OrganizationName";
        OrganizationList.DataBind();
        OrganizationList.Items.Insert(0, new ListItem("Select from list...", ""));
        return;
    }