protected void WSGridView_RowCommand(object sender, GridViewCommandEventArgs e) { if (!(e.CommandName == "InfoWS")) { return; } long selectedidWS = Convert.ToInt64(((WebControl)e.CommandSource).Attributes["1"]); HelpClassWebServices classWebServices = Enumerable.Single <HelpClassWebServices>((IEnumerable <HelpClassWebServices>) this.Session["PanelWSHelp"], (Func <HelpClassWebServices, bool>)(p => p.ID == selectedidWS)); List <PARAM> paramsForWebservice = new ParamsDAL().GetParamsForWebservice(classWebServices.WSObj); this.Label11.Text = classWebServices.Tittle + ": " + classWebServices.Description + Environment.NewLine; if (paramsForWebservice.Count != 0) { foreach (PARAM obj in paramsForWebservice) { Label label1 = new Label(); label1.Text = obj.Tittle + " -- "; label1.Font.Bold = true; Label label2 = new Label(); label2.Text = obj.Description; LiteralControl literalControl1 = new LiteralControl("<p>"); LiteralControl literalControl2 = new LiteralControl("</p>"); LiteralControl literalControl3 = new LiteralControl("<br />"); this.PanelInfoParams.Controls.Add((Control)literalControl1); this.PanelInfoParams.Controls.Add((Control)label1); this.PanelInfoParams.Controls.Add((Control)label2); this.PanelInfoParams.Controls.Add((Control)literalControl2); this.PanelInfoParams.Controls.Add((Control)literalControl3); } } }
public void FillWS(HelpClassWebServices tempWS) { this.txtName.Text = tempWS.Tittle; this.txtDescription.Text = tempWS.Description; this.txtURL.Text = tempWS.URL; this.txtNote.Text = tempWS.Note; this.txtInst.Text = ""; if (tempWS.IDInstitution != 0L) { this.txtInst.Text = tempWS.InstitutionName; } if (tempWS.Active) { this.CheckBoxTrue.Checked = true; this.CheckBoxFalse.Checked = false; } else { this.CheckBoxFalse.Checked = true; this.CheckBoxTrue.Checked = false; } this.LinkButton1.Enabled = true; this.Gridview1.Visible = false; List <PARAM> paramsForWebservice = new ParamsDAL().GetParamsForWebservice(tempWS.WSObj); this.Application["WS"] = (object)tempWS.WSObj; this.Gridview1.DataSource = (object)paramsForWebservice; this.Gridview1.DataBind(); this.GridviewParamInfo.DataSource = (object)new ParamsDAL().GetParamsForWebservice(tempWS.WSObj); this.GridviewParamInfo.DataBind(); this.PanelEditUser.CssClass = "content-box column-right"; this.EnableTxtBox(); this.Gridview1.Visible = true; this.GridviewParamInfo.Visible = false; }
protected void btn_promeni_Click(object sender, EventArgs e) { HelpClassWebServices classWebServices = (HelpClassWebServices)this.Application["TempWebService"]; bool flag = false; if (this.CheckBoxTrue.Checked) { flag = true; } if (!flag && classWebServices.Active) { this.PanelServiceDeactive.Visible = true; this.PanelServiceDeactive.Focus(); USER user = (USER)this.Session["user"]; this.txtAdminUserName.Text = user.username; this.txtAdminPass.Text = user.password; } else { new WebservicesDAL().Update(this.txtName.Text, this.txtDescription.Text, this.txtNote.Text, this.txtURL.Text, new bool?(flag), new DateTime?(), classWebServices.ID); string old = classWebServices.Tittle + ";" + classWebServices.Description + ";" + classWebServices.Note + ";" + classWebServices.URL + ";" + classWebServices.Active.ToString(); string newone = this.txtName.Text + ";" + this.txtDescription.Text + ";" + this.txtNote.Text + ";" + this.txtURL.Text + ";" + flag.ToString(); new LOGDAL().Insert(Enumerable.Single <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "WEBSERVICES")).Key, (USER)this.Session["user"], classWebServices.ID.ToString(), 2, DateTime.Now, old, newone); this.Application["ListWebServices"] = (object)new WebservicesDAL().GetWebServicesInstitutionsPermissions(true); this.WSGridView.DataSource = (object)(List <HelpClassWebServices>) this.Application["ListWebServices"]; this.WSGridView.DataBind(); this.DropDownList3.SelectedIndex = -1; } this.PanelNewUser.CssClass = "content-box column-left closed-box"; }
protected void LinkWS_Click(object sender, EventArgs e) { LinkButton linkButton = (LinkButton)sender; List <HelpClassWebServices> list = (List <HelpClassWebServices>) this.Session["PanelWS"]; string NazivServis = linkButton.Text; HelpClassWebServices classWebServices = Enumerable.Single <HelpClassWebServices>((IEnumerable <HelpClassWebServices>)list, (Func <HelpClassWebServices, bool>)(p => p.Tittle == NazivServis)); USER user = (USER)this.Session["user"]; if (user == null) { return; } if (user.Type == 1) { this.Session["AdminSelectedWS"] = (object)classWebServices; this.fillControl1("AdminPanel/wsusagea.ascx", this.btn_wsus); } else if (user.Type == 2) { this.Session["LocalSelectedWS"] = (object)classWebServices; this.fillControl1("LocalAdminPanel/wsusagel.ascx", this.btn_wsus); } else if (user.Type == 3) { this.Session["SelectedWS"] = (object)classWebServices; this.fillControl1("UserPanel/wsusage.ascx", this.btn_wsus); } }
protected void WSGridView_SelectedIndexChanged(object sender, EventArgs e) { int row = Convert.ToInt32(this.WSGridView.SelectedDataKey.Value); HelpClassWebServices classWebServices = Enumerable.Single <HelpClassWebServices>((IEnumerable <HelpClassWebServices>) this.Application["ListUserWebServices"], (Func <HelpClassWebServices, bool>)(p => p.ID == (long)row)); this.Application["TempWebService"] = (object)classWebServices; this.txtName.Text = classWebServices.Tittle; this.txtDescription.Text = classWebServices.Description; this.txtURL.Text = classWebServices.URL; this.txtNote.Text = classWebServices.Note; this.TextBoxInst.Text = classWebServices.InstitutionName; if (classWebServices.Active) { this.CheckBoxTrue.Checked = true; this.CheckBoxFalse.Checked = false; } else { this.CheckBoxFalse.Checked = true; this.CheckBoxTrue.Checked = false; } this.DisableTxtBox(); this.Gridview1.DataSource = (object)new ParamsDAL().GetParamsForWebservice(classWebServices.WSObj); this.Gridview1.DataBind(); this.PanelEditUser.CssClass = "content-box"; this.PanelEditUser.Visible = true; }
protected void WSGridView_SelectedIndexChanged(object sender, EventArgs e) { this.ClearTxtBox(); int row = Convert.ToInt32(this.WSGridView.SelectedDataKey.Value); HelpClassWebServices tempWS = Enumerable.Single <HelpClassWebServices>((IEnumerable <HelpClassWebServices>) this.Application["ListWebServices"], (Func <HelpClassWebServices, bool>)(p => p.ID == (long)row)); this.Application["TempWebService"] = (object)tempWS; this.FillWS(tempWS); this.PanelNewUser.CssClass = "content-box column-left closed-box"; }
protected void WSGridView_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType != DataControlRowType.DataRow) { return; } ImageButton imageButton = (ImageButton)e.Row.FindControl("Insert"); HelpClassWebServices classWebServices = (HelpClassWebServices)e.Row.DataItem; if (classWebServices != null) { imageButton.Attributes.Add("1", classWebServices.ID.ToString()); imageButton.CommandName = "InfoWS"; } }
protected void btn_promeni_Click(object sender, EventArgs e) { HelpClassWebServices classWebServices = (HelpClassWebServices)this.Application["TempWebService"]; bool flag = false; if (this.CheckBoxTrue.Checked) { flag = true; } new WebservicesDAL().Update(this.txtName.Text, this.txtDescription.Text, this.txtNote.Text, this.txtURL.Text, new bool?(flag), new DateTime?(), classWebServices.ID); string old = classWebServices.Tittle + ";" + classWebServices.Description + ";" + classWebServices.Note + ";" + classWebServices.URL + ";" + classWebServices.Active.ToString(); string newone = this.txtName.Text + ";" + this.txtDescription.Text + ";" + this.txtNote.Text + ";" + this.txtURL.Text + ";" + flag.ToString(); new LOGDAL().Insert(Enumerable.Single <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "WEBSERVICES")).Key, (USER)this.Session["user"], classWebServices.ID.ToString(), 2, DateTime.Now, old, newone); }
public void PageLoadStaf() { string selectedValue1 = this.DropDownList2.SelectedValue; string selectedValue2 = this.DropDownList3.SelectedValue; this.DropDownList2.Items.Clear(); ListItem listItem = new ListItem() { Value = "0", Text = "-- Листај по институција --" }; this.DropDownList2.Items.Add(new ListItem() { Value = "0", Text = "-- Листај по институција --" }); this.WSGridView.DataSource = (object)(List <HelpClassWebServices>) this.Application["ListWebServices"]; this.Session["ListOsnoviAll"] = (object)new BasisDAL().GetAllByStatus(true); if (this.Session["ListOsnoviSelected"] == null) { this.Session["ListOsnoviSelected"] = (object)new List <BASIS>(); } this.WSGridView.DataBind(); this.DropDownList2.DataSource = (object)new InstitutionsDAL().GetAllActiveDeleted(true); this.DropDownList2.DataBind(); this.DropDownList2.SelectedValue = selectedValue1; if ((List <PARAM>) this.Application["Params"] == null) { this.Gridview2.DataSource = (object)new List <PARAM>(); } else { this.Gridview2.DataSource = (object)(List <PARAM>) this.Application["Params"]; } this.Gridview2.DataBind(); if ((HelpClassWebServices)this.Session["AdminSelectedWS"] != null) { HelpClassWebServices tempWS = (HelpClassWebServices)this.Session["AdminSelectedWS"]; this.Application["TempUser"] = (object)tempWS; this.Session["AdminSelectedWS"] = (object)null; this.FillWS(tempWS); } this.DropDownList3.SelectedValue = selectedValue2; }
protected void btnPotvrdi_Click(object sender, EventArgs e) { HelpClassWebServices classWebServices = (HelpClassWebServices)this.Application["TempWebService"]; List <HelpClassUsers> webServiceAndUsage = new UsersDAL().GetUsersByWebServiceAndUsage(classWebServices.ID, 1); bool flag1 = false; if (webServiceAndUsage.Count != 0) { foreach (HelpClassUsers helpClassUsers in webServiceAndUsage) { USER user = new UsersDAL().CheckUser(this.txtLadminUserName.Text, new Crypto().EncryptStringAES(this.txtLadminPass.Text, ConfigurationManager.AppSettings["PssCrypto"])); List <PERMISSION> permisionsByUser = new PermissionsDAL().GetPermisionsByUser(user); bool flag2 = false; foreach (PERMISSION permission in permisionsByUser) { if (permission.ID_WS == classWebServices.ID && permission.Usage == 1) { flag2 = true; } } string str = new Crypto().EncryptStringAES(this.txtAdminPass.Text, ConfigurationManager.AppSettings["PssCrypto"]); if (helpClassUsers.user == this.txtAdminUserName.Text && helpClassUsers.pass == str && (helpClassUsers.Type == 1 && user != null) && (user.Type == 2 && flag2) && this.txtAdminUserName.Text != this.txtLadminUserName.Text) { flag1 = true; break; } } } if (flag1) { bool flag2 = false; new WebservicesDAL().Update(this.txtName.Text, this.txtDescription.Text, this.txtNote.Text, this.txtURL.Text, new bool?(flag2), new DateTime?(), classWebServices.ID); string old = classWebServices.Tittle + ";" + classWebServices.Description + ";" + classWebServices.Note + ";" + classWebServices.URL + ";" + classWebServices.Active.ToString(); string newone = this.txtName.Text + ";" + this.txtDescription.Text + ";" + this.txtNote.Text + ";" + this.txtURL.Text + ";" + flag2.ToString(); new LOGDAL().Insert(Enumerable.Single <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "WEBSERVICES")).Key, (USER)this.Session["user"], classWebServices.ID.ToString(), 2, DateTime.Now, old, newone); this.Application["ListWebServices"] = (object)new WebservicesDAL().GetWebServicesInstitutionsPermissions(true); this.WSGridView.DataSource = (object)(List <HelpClassWebServices>) this.Application["ListWebServices"]; this.WSGridView.DataBind(); this.DropDownList3.SelectedIndex = -1; this.PanelServiceDeactive.Visible = false; } this.PanelNewUser.CssClass = "content-box column-left closed-box"; this.PanelEditUser.CssClass = "content-box column-right"; }