예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string id = Request.Params["id"];
                // Is project added
                if (string.IsNullOrEmpty(id))
                {
                    Header.Title = PAGE_TITLE_ADD;

                    tbName.Text       = string.Empty;
                    tbEmails.Text     = string.Empty;
                    cbEnabled.Checked = true;
                    tbCron.Text       = string.Empty;
                }
                else
                {
                    Header.Title = PAGE_TITLE_EDIT;

                    DetailProjectData data = IlcWebDao.GetDetailProjectData(id);

                    tbName.Text       = data.name;
                    tbEmails.Text     = data.emails;
                    cbEnabled.Checked = (data.enabled == "1");
                    tbCron.Text       = data.cron;
                }
            }
        }
예제 #2
0
        protected void Save_Click(object sender, EventArgs e)
        {
            if (!IsValid)
            {
                return;
            }

            DetailScriptData data = new DetailScriptData();

            data.name = tbName.Text;
            data.scriptingExspression = tbScriptingExpression.Text;

            string id = Request.Params["id"];

            // Is server added
            if (string.IsNullOrEmpty(id))
            {
                id = IlcWebDao.InsertDetailScriptData(data, User).ToString();
            }
            else
            {
                data.scriptId = id;
                IlcWebDao.UpdateDetailScriptData(data, User);
            }

            Response.Write("<script type=\"text/javascript\"> window.opener.parent.__doPostBack('',''); self.close(); </script>");
        }
예제 #3
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (!IsValid)
            {
                return;
            }

            DetailItemData data = new DetailItemData();

            data.phoneNumber = tbPhone.Text.Trim();
            data.login       = tbLogin.Text.Trim();
            data.password    = tbPassword.Text.Trim();
            data.enabled     = cbEnabled.Checked ? "1" : "0";

            string id       = Request.Params["id"];
            string parentId = Request.Params["parentId"];

            // Is item added
            if (!string.IsNullOrEmpty(parentId))
            {
                data.projectId = parentId;
                IlcWebDao.InsertDetailItemData(data, User);
            }
            else if (!string.IsNullOrEmpty(id))
            {
                data.itemId = id;
                IlcWebDao.UpdateDetailItemData(data, User);
            }
            else
            {
                throw new ApplicationException("Unexpected page title");
            }

            Response.Write("<script type=\"text/javascript\"> if (window.opener) window.opener.location.reload(1); else returnValue = 'reload'; self.close(); </script>");
        }
예제 #4
0
        protected void OnNameValidate(object source, ServerValidateEventArgs args)
        {
            string id = Request.Params["id"];

            if (string.IsNullOrEmpty(id))
            {
                id = "-1";
            }
            args.IsValid = !IlcWebDao.IsScriptNameExist(args.Value, id);
        }
예제 #5
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (!IsValid)
            {
                return;
            }

            DetailServerData data = new DetailServerData();

            data.name             = tbName.Text;
            data.channels         = tbChannels.Text;
            data.connectionString = tbConnString.Text;
            data.enabled          = cbEnabled.Checked ? "1" : "0";
            //data.checker = checkerList.SelectedItem.Text == "NEW..."
            //                   ? tbChecker.Text.Trim()
            //                   : checkerList.SelectedItem.Text;
            data.checker = serviceCheckBox.Checked ? "AspirinLoginChecker" : "";
            data.cron    = tbCron.Text.Trim();

            string id      = Request.Params["id"];
            bool   isAdded = false;

            // Is server added
            if (string.IsNullOrEmpty(id))
            {
                isAdded = true;
                id      = IlcWebDao.InsertDetailServerData(data, User).ToString();
            }
            else
            {
                data.serverId = id;
                IlcWebDao.UpdateDetailServerData(data, User);
            }

            string strEvent = isAdded ? "'treeViewRefresh.server.add'" : "'treeViewRefresh.server.update'";

            string response = "<html><head><script type='text/javascript' src='" +
                              ResolveClientUrl("~/scripts/popup.js") +
                              "'></script></head><body onload=\"javascript:modalHandleClose([" +
                              strEvent + ", '" + id + "," + tbName.Text.Replace("'", "\\'") +
                              "'])\"></body></html>";

            Response.Write(response);
        }
예제 #6
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (!IsValid)
            {
                return;
            }

            DetailProjectData data = new DetailProjectData();

            data.name    = tbName.Text;
            data.emails  = tbEmails.Text.Trim();
            data.enabled = cbEnabled.Checked ? "1" : "0";
            data.cron    = tbCron.Text.Trim();


            string id       = Request.Params["id"];
            string parentId = DropDownList1.SelectedValue;
            bool   isAdded  = false;

            data.serverId = parentId;
            // Is project added
            if (string.IsNullOrEmpty(id))
            {
                isAdded = true;
                id      = IlcWebDao.InsertDetailProjectData(data, User).ToString();
            }
            else
            {
                data.projectId = id;
                IlcWebDao.UpdateDetailProjectData(data, User);
            }

            string strEvent = isAdded ? "'treeViewRefresh.project.add'" : "'treeViewRefresh.project.update'";

            string response = "<html><head><script type='text/javascript' src='" +
                              ResolveClientUrl("~/scripts/popup.js") +
                              "'></script></head><body onload=\"javascript:modalHandleClose([" +
                              strEvent + ", '" + id + "," + parentId + "," + tbName.Text.Replace("'", "\\'") +
                              "'])\"></body></html>";

            Response.Write(response);
        }
예제 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string id = Request.Params["id"];
                // Is script added
                if (string.IsNullOrEmpty(id))
                {
                    Header.Title = PAGE_TITLE_ADD;
                }
                else
                {
                    Header.Title = PAGE_TITLE_EDIT;

                    DetailScriptData data = IlcWebDao.GetDetailScriptData(Request.Params["Id"]);

                    tbName.Text = data.name;
                    tbScriptingExpression.Text = data.scriptingExspression;
                }
            }
        }
예제 #8
0
        private static ValidationInfoHierarchicalEnumerable GetHierarchicalEnumerable(string viewPath)
        {
            ValidationInfoHierarchicalEnumerable fshe = new ValidationInfoHierarchicalEnumerable();

            PathAnalyzer.ItemType type = PathAnalyzer.GetItemType(viewPath);
            switch (type)
            {
            case PathAnalyzer.ItemType.Root:
                fshe.Add(
                    new RootValidationInfoHierarchyData("Root", "Servers", viewPath));
                break;

            case PathAnalyzer.ItemType.Server:
            {
                IList <KeyValuePair <string, string> > list = IlcWebDao.GetServersList();
                foreach (KeyValuePair <string, string> kvp in list)
                {
                    fshe.Add(
                        new ServerValidationInfoHierarchyData(kvp.Key, kvp.Value, viewPath));
                }
            }
            break;

            case PathAnalyzer.ItemType.Project:
            {
                IList <KeyValuePair <string, string> > list =
                    IlcWebDao.GetProjectsList(PathAnalyzer.GetServerId(viewPath));
                foreach (KeyValuePair <string, string> kvp in list)
                {
                    fshe.Add(new ProjectValidationInfoHierarchyData(kvp.Key, kvp.Value, viewPath));
                }
            }
            break;

            default:
                throw new ApplicationException("Unexpected type of tree node");
            }
            return(fshe);
        }
예제 #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string id = Request.Params["id"];
                // Is server added
                if (string.IsNullOrEmpty(id))
                {
                    Header.Title = PAGE_TITLE_ADD;

                    tbName.Text             = string.Empty;
                    tbChannels.Text         = "2";
                    tbConnString.Text       = string.Empty;
                    cbEnabled.Checked       = true;
                    serviceCheckBox.Checked = true;
                    //tbChecker.Text = string.Empty;
                    tbCron.Text = string.Empty;
                }
                else
                {
                    Header.Title = PAGE_TITLE_EDIT;

                    DetailServerData data = IlcWebDao.GetDetailServerData(Request.Params["Id"]);

                    RangeValidator1.Text = string.Format("Enter number from {0} to {1}",
                                                         RangeValidator1.MinimumValue, RangeValidator1.MaximumValue);

                    tbName.Text             = data.name;
                    tbChannels.Text         = data.channels;
                    tbConnString.Text       = data.connectionString;
                    cbEnabled.Checked       = (data.enabled == "1");
                    serviceCheckBox.Checked = (!string.IsNullOrEmpty(data.checker));
                    //tbChecker.Text = data.checker;
                    tbCron.Text = data.cron;
                }
            }
        }
예제 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string parentId = Request.Params["parentId"];
                // Is item added
                if (!string.IsNullOrEmpty(parentId))
                {
                    Header.Title = PAGE_TITLE_ADD;

                    tbPhone.Text      = string.Empty;
                    tbLogin.Text      = string.Empty;
                    tbPassword.Text   = string.Empty;
                    cbEnabled.Checked = true;

                    return;
                }

                string id = Request.Params["id"];
                if (!string.IsNullOrEmpty(id))
                {
                    Header.Title = PAGE_TITLE_EDIT;


                    DetailItemData data = IlcWebDao.GetDetailItemData(id);

                    tbPhone.Text      = data.phoneNumber;
                    tbLogin.Text      = data.login;
                    tbPassword.Text   = data.password;
                    cbEnabled.Checked = (data.enabled == "1");

                    return;
                }

                throw new ApplicationException("Unexpected query string");
            }
        }
예제 #11
0
 public override bool ValidateUser(string strName, string strPassword)
 {
     return(IlcWebDao.IsUserExist(strName, strPassword));
 }