Пример #1
0
        protected void GridviewOsnoviNaBaranjeChange_RowCreated(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType != DataControlRowType.DataRow)
            {
                return;
            }
            ImageButton imageButton = (ImageButton)e.Row.FindControl("Insert");
            BASIS       c           = (BASIS)e.Row.DataItem;

            if (c != null)
            {
                imageButton.Attributes.Add("1", c.ID.ToString());
                List <WEBSERVICESBASIS> list = (List <WEBSERVICESBASIS>) this.Session["SelectedWSBase"];
                try
                {
                    Enumerable.First <WEBSERVICESBASIS>((IEnumerable <WEBSERVICESBASIS>)list, (Func <WEBSERVICESBASIS, bool>)(p => p.ID_Basis == c.ID));
                    imageButton.ImageUrl    = "../rerources/images/add.png";
                    imageButton.CommandName = "DeleteWS";
                }
                catch
                {
                    imageButton.CommandName = "InsertWS";
                }
            }
        }
Пример #2
0
        protected void btn_promeni_Click(object sender, EventArgs e)
        {
            bool  @checked = this.CheckBoxPTrue.Checked;
            BASIS basis    = (BASIS)this.Application["Basis"];
            List <WEBSERVICESBASIS> activeByBasisId = new WSBasisDAL().GetActiveByBasisID(basis.ID);

            if (activeByBasisId != null && activeByBasisId.Count == 0)
            {
                new BasisDAL().Update(this.txtPName.Text, @checked, new DateTime?(), basis.ID);
                string old    = this.txtName.Text + ";" + 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 == "BASIS")).Key, (USER)this.Session["user"], basis.ID.ToString(), 1, DateTime.Now, old, newone);
                this.ClearTxtBoxChange();
                this.Application["ListBasis"]   = (object)new BasisDAL().GetAllByStatus(true);
                this.WSBasisGridView.DataSource = (object)(List <BASIS>) this.Application["ListBasis"];
                this.WSBasisGridView.DataBind();
                this.PanelEditUser.CssClass = "content-box column-right closed-box";
                this.PanelNewUser.CssClass  = "content-box column-left closed-box";
                this.CheckBoxTrue.Checked   = true;
            }
            else
            {
                this.PanelBasisDeactive.Visible = true;
            }
        }
Пример #3
0
        public long Insert(string tittle, bool active, DateTime createdon)
        {
            DataClasses1DataContext classes1DataContext = new DataClasses1DataContext();
            BASIS entity = new BASIS();

            entity.Tittle    = tittle;
            entity.CreatedOn = createdon;
            entity.Active    = active;
            classes1DataContext.BASIS.InsertOnSubmit(entity);
            classes1DataContext.SubmitChanges();
            return(entity.ID);
        }
Пример #4
0
        public void Update(string tittle, bool active, DateTime?created, long id)
        {
            DataClasses1DataContext classes1DataContext = new DataClasses1DataContext();
            BASIS basis = Queryable.Single <BASIS>((IQueryable <BASIS>)classes1DataContext.BASIS, (Expression <Func <BASIS, bool> >)(p => p.ID == id));

            if (tittle != null)
            {
                basis.Tittle = Convert.ToString(tittle);
            }
            bool flag = 1 == 0;

            basis.Active = Convert.ToBoolean(active);
            if (created.HasValue)
            {
                basis.CreatedOn = Convert.ToDateTime((object)created);
            }
            classes1DataContext.SubmitChanges();
        }
Пример #5
0
        protected void WSBasisGridView_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.ClearTxtBoxChange();
            int   row   = Convert.ToInt32(this.WSBasisGridView.SelectedDataKey.Value);
            BASIS basis = Enumerable.Single <BASIS>((IEnumerable <BASIS>) this.Application["ListBasis"], (Func <BASIS, bool>)(p => p.ID == (long)row));

            this.Application["Basis"] = (object)basis;
            this.txtPName.Text        = basis.Tittle;
            if (basis.Active)
            {
                this.CheckBoxPTrue.Checked  = true;
                this.CheckBoxPFalse.Checked = false;
            }
            else
            {
                this.CheckBoxPFalse.Checked = true;
                this.CheckBoxPTrue.Checked  = false;
            }
            this.LinkButton3.Enabled    = true;
            this.PanelEditUser.CssClass = "content-box column-right";
            this.PanelNewUser.CssClass  = "content-box column-left closed-box";
        }