Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string CS = ConfigurationManager.ConnectionStrings["oacConnectionString"].ConnectionString;

            using (SqlConnection con = new SqlConnection(CS))
            {
                if (!IsPostBack)
                {
                    SqlCommand cmd2 = new SqlCommand("SELECT [OrgName], [OrgID] FROM [Organizations]", con);
                    con.Open();
                    OrgName.DataSource     = cmd2.ExecuteReader();
                    OrgName.DataTextField  = "OrgName"; //Column name
                    OrgName.DataValueField = "OrgID";   //column name
                    OrgName.DataBind();
                    con.Close();
                }
            }

            if (Session["username"] == null)
            {
                Response.Redirect("index.aspx");
            }

            lblUserName.Text = "" + Session["username"];
        }
Esempio n. 2
0
        private static void PersistGovernmentUnit(string code, OrgName name, IList <OrgUnit> orgunits)
        {
            var govUnit = new Organization
            {
                Code        = code,
                CurrentName = name,
                OrgUnits    = orgunits
            };

            govUnit.Persist(context);
        }
Esempio n. 3
0
        public OrgItemListView()
        {
            InitializeComponent();

            id.Completed += (sender, e) =>
            {
                OrgName.Focus();
            };
            OrgName.Completed += (sender, e) =>
            {
                Designation.Focus();
            };
            Designation.Completed += (sender, e) =>
            {
                City.Focus();
            };
        }
Esempio n. 4
0
        private void WriteAttributes(XmlWriter w, bool newGuids = false)
        {
            if (newGuids)
            {
                w.WriteAttributeString("Id", Guid.NewGuid().ToString());
            }
            else
            {
                w.WriteAttributeString("Id", Id.ToString());
            }

            w.WriteAttributeString("Order", Order.ToString());
            w.WriteAttributeString("Field", ConditionName);
            w.WriteAttributeString("Comparison", Comparison);
            if (Description.HasValue())
            {
                w.WriteAttributeString("Description", Description);
            }
            if (PreviousName.HasValue())
            {
                w.WriteAttributeString("PreviousName", Description);
            }
            if (TextValue.HasValue())
            {
                w.WriteAttributeString("TextValue", TextValue);
            }
            if (DateValue.HasValue)
            {
                w.WriteAttributeString("DateValue", DateValue.ToString());
            }
            if (CodeIdValue.HasValue())
            {
                w.WriteAttributeString("CodeIdValue", CodeIdValue);
            }
            if (StartDate.HasValue)
            {
                w.WriteAttributeString("StartDate", StartDate.ToString());
            }
            if (EndDate.HasValue)
            {
                w.WriteAttributeString("EndDate", EndDate.ToString());
            }
            if (Program > 0)
            {
                w.WriteAttributeString("Program", Program.ToString());
            }
            if (Division > 0)
            {
                w.WriteAttributeString("Division", Division.ToString());
            }
            if (Organization > 0)
            {
                w.WriteAttributeString("Organization", Organization.ToString());
            }
            if (OrgType > 0)
            {
                w.WriteAttributeString("OrgType", OrgType.ToString());
            }
            if (Days > 0)
            {
                w.WriteAttributeString("Days", Days.ToString());
            }
            if (Quarters.HasValue())
            {
                w.WriteAttributeString("Quarters", Quarters);
            }
            if (Tags.HasValue())
            {
                w.WriteAttributeString("Tags", Tags);
            }
            if (Schedule != 0)
            {
                w.WriteAttributeString("Schedule", Schedule.ToString());
            }
            if (Campus > 0)
            {
                w.WriteAttributeString("Campus", Campus.ToString());
            }
            if (ConditionName != "FamilyHasChildrenAged")
            {
                Age = null;
            }
            if (Age.HasValue)
            {
                w.WriteAttributeString("Age", Age.ToString());
            }
            if (SavedQuery.HasValue())
            {
                w.WriteAttributeString("SavedQueryIdDesc", SavedQuery);
            }
            if (OnlineReg.HasValue)
            {
                w.WriteAttributeString("OnlineReg", OnlineReg.ToString());
            }
            if (OrgStatus.HasValue)
            {
                w.WriteAttributeString("OrgStatus", OrgStatus.ToString());
            }
            if (OrgType2.HasValue)
            {
                w.WriteAttributeString("OrgType2", OrgType2.ToString());
            }
            if (OrgName.HasValue())
            {
                w.WriteAttributeString("OrgName", OrgName);
            }
        }
Esempio n. 5
0
        protected override void Execute(CodeActivityContext context)
        {
            System.Net.WebRequest req = System.Net.WebRequest.Create("https://app.pipefy.com/queries");
            req.Proxy.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
            req.Timeout           = 120000;
            req.Headers.Add("authorization", "Bearer " + Bearer.Get(context));
            req.ContentType = "application/json";
            req.Method      = "POST";
            byte[] bytes = System.Text.Encoding.UTF8.GetBytes("{ \"query\": \"mutation { createOrganization(input: {industry: \"" + Industry.Get(context) + "\", name: \"" + OrgName.Get(context) + "\" }) { organization{ id, name } } }\" }");
            req.ContentLength = bytes.Length;
            System.IO.Stream os = req.GetRequestStream();
            os.Write(bytes, 0, bytes.Length);
            os.Close();
            System.Net.WebResponse resp = req.GetResponse();
            System.IO.StreamReader sr   = new System.IO.StreamReader(resp.GetResponseStream());
            JArray  array      = new JArray();
            JObject joResponse = JObject.Parse(sr.ReadToEnd());

            Return.Set(context, joResponse.ToString());
        }
Esempio n. 6
0
 public override int GetHashCode()
 {
     return(Id.GetHashCode()
            ^ OrgName.GetHashCode()
            ^ Type.GetHashCode());
 }
Esempio n. 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Check the session the ensure user is valid
            if (Session["username"] == null)
            {
                Response.Redirect("index.aspx");
            }

            //Displays the username in the top navigation bar
            lblUserName.Text = "" + Session["username"];


            string CS = ConfigurationManager.ConnectionStrings["oacConnectionString"].ConnectionString;

            using (SqlConnection con = new SqlConnection(CS))
            {
                if (!IsPostBack)
                {
                    SqlCommand cmd = new SqlCommand("SELECT [ItemName] FROM [Handlers] WHERE Category LIKE '%City%'",
                                                    con);
                    con.Open();
                    City.DataSource     = cmd.ExecuteReader();
                    City.DataTextField  = "ItemName"; //Column name
                    City.DataValueField = "ItemName"; //column name
                    City.DataBind();
                    con.Close();

                    SqlCommand cmd2 = new SqlCommand("SELECT [OrgName], [OrgID] FROM [Organizations]", con);
                    con.Open();
                    OrgName.DataSource     = cmd2.ExecuteReader();
                    OrgName.DataTextField  = "OrgName"; //Column name
                    OrgName.DataValueField = "OrgID";   //column name
                    OrgName.DataBind();
                    con.Close();

                    SqlCommand cmdStreamOne =
                        new SqlCommand("SELECT [ItemName] FROM [Handlers] WHERE Category LIKE '%Stream%'", con);
                    con.Open();
                    StreamOne.DataSource     = cmdStreamOne.ExecuteReader();
                    StreamOne.DataTextField  = "ItemName"; //Column name
                    StreamOne.DataValueField = "ItemName"; //column name
                    StreamOne.DataBind();
                    con.Close();

                    SqlCommand cmdStreamTwo =
                        new SqlCommand("SELECT [ItemName] FROM [Handlers] WHERE Category LIKE '%Stream%'", con);
                    con.Open();
                    StreamTwo.DataSource     = cmdStreamTwo.ExecuteReader();
                    StreamTwo.DataTextField  = "ItemName"; //Column name
                    StreamTwo.DataValueField = "ItemName"; //column name
                    StreamTwo.DataBind();
                    con.Close();

                    SqlCommand cmdCategoryOne =
                        new SqlCommand("SELECT [ItemName] FROM [Handlers] WHERE Category LIKE '%Category%'", con);
                    con.Open();
                    CategoryOne.DataSource     = cmdCategoryOne.ExecuteReader();
                    CategoryOne.DataTextField  = "ItemName"; //Column name
                    CategoryOne.DataValueField = "ItemName"; //column name
                    CategoryOne.DataBind();
                    con.Close();

                    SqlCommand cmdCategoryTwo =
                        new SqlCommand("SELECT [ItemName] FROM [Handlers] WHERE Category LIKE '%Category%'", con);
                    con.Open();
                    CategoryTwo.DataSource     = cmdCategoryTwo.ExecuteReader();
                    CategoryTwo.DataTextField  = "ItemName"; //Column name
                    CategoryTwo.DataValueField = "ItemName"; //column name
                    CategoryTwo.DataBind();
                    con.Close();

                    SqlCommand cmdTargetOne =
                        new SqlCommand("SELECT [ItemName] FROM [Handlers] WHERE Category LIKE '%Target%'", con);
                    con.Open();
                    TargetOne.DataSource     = cmdTargetOne.ExecuteReader();
                    TargetOne.DataTextField  = "ItemName"; //Column name
                    TargetOne.DataValueField = "ItemName"; //column name
                    TargetOne.DataBind();
                    con.Close();

                    SqlCommand cmdTargetTwo =
                        new SqlCommand("SELECT [ItemName] FROM [Handlers] WHERE Category LIKE '%Target%'", con);
                    con.Open();
                    TargetTwo.DataSource     = cmdTargetTwo.ExecuteReader();
                    TargetTwo.DataTextField  = "ItemName"; //Column name
                    TargetTwo.DataValueField = "ItemName"; //column name
                    TargetTwo.DataBind();
                    con.Close();
                }
            }
        }