예제 #1
0
파일: ws.cs 프로젝트: darkogele/Rabota
 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();
         }
     }
 }
예제 #2
0
파일: ws.cs 프로젝트: darkogele/Rabota
 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
     {
     }
 }