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); } } }
protected void Gridview1_RowDeleting(object sender, GridViewDeleteEventArgs e) { WEBSERVICE ws = (WEBSERVICE)this.Application["WS"]; string TittleText = ((TextBox)this.Gridview1.Rows[e.RowIndex].FindControl("EditTittle")).Text; string DescText = ((TextBox)this.Gridview1.Rows[e.RowIndex].FindControl("EditDescription")).Text; if (ws == null) { return; } List <PARAM> paramsForWebservice = new ParamsDAL().GetParamsForWebservice(ws); try { PARAM obj = Enumerable.Single <PARAM>((IEnumerable <PARAM>)paramsForWebservice, (Func <PARAM, bool>)(p => p.Description == DescText && p.Tittle == TittleText)); new ParamsDAL().Delete(obj.ID); string old = ""; string newone = ""; new LOGDAL().Insert(Enumerable.Single <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "PARAMS")).Key, (USER)this.Session["user"], obj.ID.ToString(), 3, DateTime.Now, old, newone); this.Gridview1.DataSource = (object)new ParamsDAL().GetParamsForWebservice(ws); this.Gridview1.DataBind(); } catch { this.Gridview1.DataSource = (object)new ParamsDAL().GetParamsForWebservice(ws); this.Gridview1.DataBind(); } }
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_vnesi_Click(object sender, EventArgs e) { try { if (this.DropDownList2.SelectedValue != "0") { bool active = true; long id = new WebservicesDAL().Insert(this.txtPName.Text, this.txtPDescription.Text, this.txtPNote.Text, this.txtPURL.Text, active, DateTime.Now); string old1 = this.txtPName.Text + ";" + this.txtPDescription.Text + ";" + this.txtPNote.Text + ";" + this.txtPURL.Text + ";" + active.ToString(); string newone1 = ""; 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"], id.ToString(), 1, DateTime.Now, old1, newone1); USER user = (USER)this.Session["user"]; INSTITUTION byId1 = new InstitutionsDAL().GetByID((long)Convert.ToInt32(this.DropDownList2.SelectedValue)); WEBSERVICE byId2 = new WebservicesDAL().GetByID(id); long num1 = new PermissionsDAL().Insert(byId1, user, byId2, 1, true, DateTime.Now); string old2 = ""; string newone2 = ""; new LOGDAL().Insert(Enumerable.Single <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "PERMISSIONS")).Key, (USER)this.Session["user"], num1.ToString(), 1, DateTime.Now, old2, newone2); List <PARAM> list = (List <PARAM>) this.Application["Params"]; KeyValuePair <int, string> keyValuePair = Enumerable.Single <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "PARAMS")); foreach (PARAM obj in list) { long num2 = new ParamsDAL().Insert(obj.Tittle, obj.Description, obj.MaxLength, obj.Type, byId2, true); string old3 = obj.Tittle + (object)";" + obj.Description + ";" + (string)(object)obj.MaxLength + ";" + (string)(object)obj.Type + ";" + true.ToString(); string newone3 = ""; new LOGDAL().Insert(keyValuePair.Key, (USER)this.Session["user"], num2.ToString(), 1, DateTime.Now, old3, newone3); } foreach (BASIS basis in (List <BASIS>) this.Session["ListOsnoviSelected"]) { Enumerable.Single <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "WEBSERVICESBASIS")); } this.ClearTxtBoxChange(); this.Application["Params"] = (object)null; 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"; this.PanelEditUser.CssClass = "content-box column-right closed-box"; } catch { } }
protected void Gridview1_SelectedIndexChanged(object sender, EventArgs e) { TextBox textBox1 = (TextBox)this.Gridview1.SelectedRow.FindControl("EditTittle"); TextBox textBox2 = (TextBox)this.Gridview1.SelectedRow.FindControl("EditDescription"); long id = Convert.ToInt64(this.Gridview1.SelectedDataKey.Value); WEBSERVICE ws = (WEBSERVICE)this.Application["WS"]; if (ws == null) { return; } PARAM byId = new ParamsDAL().GetByID(id); new ParamsDAL().Update(textBox1.Text, textBox2.Text, new int?(), new int?(), (WEBSERVICE)null, new bool?(), id); string old = byId.Tittle + ";" + byId.Description; string newone = textBox1.Text + ";" + textBox2.Text; new LOGDAL().Insert(Enumerable.Single <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "PARAMS")).Key, (USER)this.Session["user"], id.ToString(), 2, DateTime.Now, old, newone); this.Gridview1.DataSource = (object)new ParamsDAL().GetParamsForWebservice(ws); this.Gridview1.DataBind(); }
protected void Gridview1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "NoDataInsert") { TextBox textBox1 = (TextBox)this.Gridview1.Controls[0].Controls[0].FindControl("NoDataTittle"); TextBox textBox2 = (TextBox)this.Gridview1.Controls[0].Controls[0].FindControl("NoDataDescription"); WEBSERVICE ws = (WEBSERVICE)this.Application["WS"]; if (ws == null) { return; } long num = new ParamsDAL().Insert(textBox1.Text, textBox2.Text, 50, 1, ws, true); string old = textBox1.Text + ";" + textBox2.Text + ";50;1;" + true.ToString(); string newone = ""; new LOGDAL().Insert(Enumerable.Single <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "PARAMS")).Key, (USER)this.Session["user"], num.ToString(), 1, DateTime.Now, old, newone); this.Gridview1.DataSource = (object)new ParamsDAL().GetParamsForWebservice(ws); this.Gridview1.DataBind(); } else { if (!(e.CommandName == "InsertNew")) { return; } TextBox textBox1 = (TextBox)this.Gridview1.FooterRow.FindControl("InsertTittle"); TextBox textBox2 = (TextBox)this.Gridview1.FooterRow.FindControl("InsertDescription"); WEBSERVICE ws = (WEBSERVICE)this.Application["WS"]; if (ws != null) { long num = new ParamsDAL().Insert(textBox1.Text, textBox2.Text, 50, 1, ws, true); string old = textBox1.Text + ";" + textBox2.Text + ";50;1;" + true.ToString(); string newone = ""; new LOGDAL().Insert(Enumerable.Single <KeyValuePair <int, string> >((IEnumerable <KeyValuePair <int, string> >)InteropDAL.TablesDictionary, (Func <KeyValuePair <int, string>, bool>)(p => p.Value == "PARAMS")).Key, (USER)this.Session["user"], num.ToString(), 1, DateTime.Now, old, newone); this.Gridview1.DataSource = (object)new ParamsDAL().GetParamsForWebservice(ws); this.Gridview1.DataBind(); } } }