예제 #1
0
파일: myGames.aspx.cs 프로젝트: lihiaq/run
    protected void deleteRow(object sender, EventArgs e)                                                                //Delete game Func after user clicks on Delete button from delete POPUP alert
    {
        string gameName = (string)Session["gameNameToDelete"];                                                          // the requested game to delete

        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(" + gameName + ")", true); //alert, can delete later
        string deleteGameQuery = "DELETE FROM games WHERE gameName = '" + gameName + "'";                               //Delete game query

        myDataClass.updSql(deleteGameQuery);
        GridViewTable.DataBind();

        //Incase user deleted all games
        string  gamesListQuery = "SELECT COUNT(*)  FROM games where userID = " + UserID; //QUERY THAT COUNTS HOW MANY GAMES USER CREATED
        DataSet AllGames       = myDataClass.sqlRet(gamesListQuery);
        int     myGamesNum     = Convert.ToInt16(AllGames.Tables[0].Rows[0][0]);
        int     Games          = myGamesNum;

        if (Games == 0)
        {
            noGames.Visible = true;
            arrow.Visible   = true;
        }
        else
        {
            noGames.Visible = false;
            arrow.Visible   = false;
        }
        ifPublishedCB();
    }
예제 #2
0
        private void CargarGridView()
        {
            string resultado  = "";
            var    objeto     = new SitioWeb.Controlador.ClassMedia();
            string st         = Request.QueryString["st"] as string;
            string uidproceso = "";

            if (!string.IsNullOrEmpty(st))
            {
                List <Controlador.ClassProceso> proceso = Controlador.SqlProceso.Select(ClasesUtiles.SessionClass.GetLoginUser(Page).classLoginUser.uidsuario,
                                                                                        new Controlador.ClassProceso()
                {
                    uidserviciotecnico = st
                }, out resultado);
                uidproceso = proceso.FirstOrDefault().uidproceso;
            }
            if (!string.IsNullOrEmpty(uidtipoComentario))
            {
                objeto.uidtipocomentario = uidtipoComentario;
                objeto.uidproceso        = uidproceso;
            }
            var retSelect = SitioWeb.Controlador.SqlMedia.SelectDataTable(ClasesUtiles.SessionClass.GetLoginUser(Page).classLoginUser.uidsuario, objeto, out resultado);

            GridViewTable.DataSource = retSelect;
            GridViewTable.DataBind();
        }
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            DbTools dbt = new DbTools();

            GridViewTable.DataSource = dbt.GetData(DropDownList1.SelectedValue);
            GridViewTable.DataBind();
        }
예제 #4
0
        public void BindData(BindType bindType)
        {
            if (bindType == BindType.Form)
            {
                var queryargument = new QueryArgument(UserContext.DataBaseInfo)
                {
                    Key          = CountryId,
                    filter1      = Constants.CountryType,
                    BindType     = bindType,
                    QueryType    = Constants.TableMCatHeader,
                    SubFilterKey = Constants.TableMCatDetls
                };
                var countries = _controlPanel.GetCountry(queryargument);

                if (countries == null)
                {
                    return;
                }
                var country = countries.FirstOrDefault();
                if (country != null)
                {
                    CountryId      = country.CountryId;
                    CountryName    = country.CountryName.Trim();
                    CurrencyCode   = country.CurrencyCode.Trim();
                    CurrencyName   = country.CurrencyName.Trim();
                    CurrencySymbol = country.CurrencySymbol.Trim();
                    Denomination   = country.Denomination.Trim();
                }
                lnkSubmit.Visible = hidAction.Value != Constants.ViewAction;

                var state = country.States;
                GridViewState.DataSource = state;
                if (_newPageIndex >= 0)
                {
                    GridViewState.PageIndex = _newPageIndex;
                }
                GridViewState.DataBind();
                uplForm.Update();
            }
            else
            {
                var queryargument = new QueryArgument(UserContext.DataBaseInfo)
                {
                    Key       = CountryId,
                    filter1   = Constants.CountryType,
                    BindType  = bindType,
                    QueryType = Constants.TableMCatHeader
                };
                var countries = _controlPanel.GetCountry(queryargument);

                GridViewTable.DataSource = countries;
                if (_newPageIndex >= 0)
                {
                    GridViewTable.PageIndex = _newPageIndex;
                }
                GridViewTable.DataBind();
                uplView.Update();
            }
        }
예제 #5
0
        public void BindData(CompanyProfiles companyProfiles, BindType bindType)
        {
            if (companyProfiles == null)
            {
                return;
            }
            if (bindType == BindType.Form)
            {
                var companyProfile = companyProfiles.FirstOrDefault();

                if (companyProfile != null)
                {
                    Id   = companyProfile.Id;
                    Name = companyProfile.Name.Trim();

                    Address.Address = companyProfile.Address.Trim();
                    Address.City    = companyProfile.City.Trim();
                    Address.Country = companyProfile.Country.Trim();
                    Address.State   = companyProfile.State.Trim();
                    Address.ZipCode = companyProfile.Zip.Trim();
                    Address.Email   = companyProfile.Email.Trim();
                    //Address.Mobile = companyProfile.Mobile.Trim();
                    Address.Phone = companyProfile.Phone.Trim();
                    Logo          = companyProfile.Logo;
                    if (CType == Constants.CompanyCType || CType == Constants.BuCType)
                    {
                        Cst                 = companyProfile.Tax1.Trim();
                        Tin                 = companyProfile.Tax2.Trim();
                        Excise              = companyProfile.Tax3.Trim();
                        ExciseActiveTill    = companyProfile.TaxValidity3.Trim();
                        FinancialPeriodFrom =
                            companyProfile.FinancialYearStart.GetValueOrDefault().ToString(Constants.Format02);
                        FinancialPeriodTo =
                            companyProfile.FinancialYearEnd.GetValueOrDefault().ToString(Constants.Format02);
                        TransactionCurrency = companyProfile.TrnCurrency;
                    }
                    else
                    {
                        ContactPersonName1  = companyProfile.CName;
                        ContactPersonPhone1 = companyProfile.CPhone;
                    }
                }
                lnkSave.Visible = hidAction.Value != Constants.ViewAction;
                uplForm.Update();
            }
            else
            {
                GridViewTable.DataSource = companyProfiles;
                if (_newPageIndex >= 0)
                {
                    GridViewTable.PageIndex = _newPageIndex;
                }
                GridViewTable.DataSource = companyProfiles;
                GridViewTable.DataBind();
                uplView.Update();
            }
        }
        private void CargarGridView()
        {
            string resultado = "";
            var    objeto    = new SitioWeb.Controlador.ClassEmpleado();
            var    retSelect = SitioWeb.Controlador.SqlEmpleado.Select(ClasesUtiles.SessionClass.GetLoginUser(Page).classLoginUser.uidsuario, objeto, out resultado);

            GridViewTable.DataSource = retSelect;
            GridViewTable.DataBind();
        }
예제 #7
0
파일: myGames.aspx.cs 프로젝트: lihiaq/run
    protected void saveGameFunc(object sender, EventArgs e) //Game creation function
    {
        string newGameName = addNewGame.Text;               //Inserting the text from the text box to VAR
        //Creating new game UPDATE   query
        string ChangeGameNameQuary = "INSERT INTO games (gamename, published, userID, share) VALUES('" + newGameName + "', false, " + UserID + ", false)";

        myDataClass.updSql(ChangeGameNameQuary); //call to sqlClass
        GridViewTable.DataBind();                //update the gridview
        addNewGame.Text            = "";         // clearing text box
        gameNameCounterLabel.Value = "0/20";
        ifPublishedCB();
    }
예제 #8
0
 private void BindData(Materials parts)
 //private void BindData()
 {
     GridViewTable.DataSource = parts;
     if (_newPageIndex >= 0)
     {
         GridViewTable.PageIndex = _newPageIndex;
     }
     GridViewTable.DataSource = parts;
     GridViewTable.DataBind();
     uplView.Update();
 }
예제 #9
0
        public void BindData(BindType bindType)
        {
            var queryArgument = new QueryArgument(UserContext.DataBaseInfo)
            {
                Key       = TeamId.ToString(),
                filter1   = Type,
                filter4   = bindType == BindType.List ? Constants.RetriveList : Constants.RetriveForm,
                FilterKey = Constants.TableWFComponents
            };
            var teamMasters = _controlPanel.GetTeams(queryArgument);

            if (teamMasters != null)
            {
                if (bindType == BindType.Form)
                {
                    var firstOrDefault = teamMasters.FirstOrDefault();
                    if (firstOrDefault == null)
                    {
                        return;
                    }
                    TeamId     = firstOrDefault.ComponentId;
                    TeamName   = firstOrDefault.ComponentDesp;
                    Categories = WebControls.SetCheckboxListSelectedItem(Categories, firstOrDefault.Relation1.SplitTo <string>(new string[] { Constants.DelimeterSinglePipe }).ToList());

                    Users = WebControls.SetCheckboxListSelectedItem(Users, firstOrDefault.wfComponentSubs.Select(x => x.WFCSCode).ToList());
                    uplForm.Update();
                }
                else
                {
                    var team = teamMasters.ToList();
                    if (UserContext.UserProfile.Designation.Id.Trim() != "SA")
                    {
                        if (teamMasters.Any())
                        {
                            team = teamMasters.Where(x => x.ComponentId.Trim() != "13").ToList();
                        }
                    }
                    GridViewTable.DataSource = team;
                    if (_newPageIndex >= 0)
                    {
                        GridViewTable.PageIndex = _newPageIndex;
                    }
                    GridViewTable.DataSource = team;
                    GridViewTable.DataBind();
                    UplView.Update();
                }
            }
        }
예제 #10
0
 public void BindData(Categories categories)
 {
     if (categories == null)
     {
         var queryArgument = new QueryArgument(UserContext.DataBaseInfo)
         {
             filter1   = Constants.PartType,
             filter2   = FRType,
             FilterKey = Constants.TableMCatDetls
         };
         categories = _controlPanel.GetCategories(queryArgument);
     }
     GridViewTable.DataSource = categories;
     GridViewTable.DataBind();
     uplView.Update();
 }
예제 #11
0
        public void BindData(BindType bindType)
        {
            var queryArgument = new QueryArgument(UserContext.DataBaseInfo)
            {
                Key       = Code.ToString(),
                filter1   = LType,
                filter2   = Constants.LedgerSub,
                filter3   = LMode,
                filter4   = bindType == BindType.List ? Constants.RetriveList : Constants.RetriveForm,
                FilterKey = Constants.TableAccounts
            };
            var accounts = _controlPanel.GetAccounts(queryArgument);

            if (accounts != null)
            {
                if (bindType == BindType.Form)
                {
                    var firstOrDefault = accounts.FirstOrDefault();
                    if (firstOrDefault == null)
                    {
                        return;
                    }
                    Code                    = firstOrDefault.SName;
                    Name                    = firstOrDefault.Name;
                    CreatedDate             = firstOrDefault.Created;
                    ContactPerson           = firstOrDefault.ContactPerson;
                    BasicAddress.DataSource = firstOrDefault.Address;
                    uplForm.Update();
                }
                else
                {
                    GridViewTable.DataSource = accounts;
                    if (_newPageIndex >= 0)
                    {
                        GridViewTable.PageIndex = _newPageIndex;
                    }
                    GridViewTable.DataSource = accounts;
                    GridViewTable.DataBind();
                    if (IsUpload)
                    {
                        GridViewTable.Columns[3].Visible = false;
                    }
                    uplView.Update();
                }
            }
        }
예제 #12
0
파일: myGames.aspx.cs 프로젝트: lihiaq/run
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)     // this function will run with any click on the text boxeS
    {
        // finding the ID of the item in the XML
        CheckBox myCheckBox = (CheckBox)sender;
        // Attract the item's ID using the manually added attribute to the box
        string theId = myCheckBox.Attributes["theItemId"];
        //A query to find the game we want to update
        string  gameToUpdte            = "select * from games where ID = " + theId;
        DataSet gameToUpdateQuery      = myDataClass.sqlRet(gameToUpdte);                   //call to sqlClass
        string  gamgToUpdateQueryCheck = gameToUpdateQuery.Tables[0].Rows[0][0].ToString(); //show the data
        //Receive the new value of the textbox after a click
        bool NewIsPass = myCheckBox.Checked;
        //Update the attribute in the DB
        string updatePublishAtt = "UPDATE games set published =" + NewIsPass.ToString() + " where ID =" + gamgToUpdateQueryCheck;

        myDataClass.updSql(updatePublishAtt);  //call to sqlClass
        GridViewTable.DataBind();
        //ifPublishedCB();
    }
예제 #13
0
 protected void ChangeGrid(object sender, EventArgs e)
 {
     try
     {
         if (SqlMidlandsFly.Instance.TableExists(SqlMidlandsFly.Instance.Table_Employees))
         {
             MidlandsFly_Employees.SelectCommand = command;
             GridViewTable.DataSourceID          = MidlandsFly_Employees.ID;
             GridViewTable.DataBind();
         }
         else
         {
             this.Master.ErrMessage = (String.Format("Table {0} does not exist. Please restart the simulation or contact an administrator.", SqlMidlandsFly.Instance.Table_Employees.Name));
         }
     }
     catch (Exception ex)
     {
         this.Master.ErrMessage = String.Format("Message: {0}", ex.Message);
     }
 }
예제 #14
0
        public void BindData(BindType bindType)
        {
            var queryArgument = new QueryArgument(UserContext.DataBaseInfo)
            {
                Key       = StageId.ToString(),
                filter1   = Type,
                filter4   = bindType == BindType.List ? Constants.RetriveList : Constants.RetriveForm,
                FilterKey = Constants.TableWFComponents
            };
            var stageMasters = _controlPanel.GetStages(queryArgument);

            if (stageMasters != null)
            {
                if (bindType == BindType.Form)
                {
                    var firstOrDefault = stageMasters.FirstOrDefault();
                    if (firstOrDefault == null)
                    {
                        return;
                    }
                    StageId        = firstOrDefault.Id;
                    StageName      = firstOrDefault.Stage;
                    Link           = firstOrDefault.ActionLink;
                    Teams          = WebControls.SetCheckboxListSelectedItem(Teams, firstOrDefault.Relation1.SplitTo <string>(new string[] { Constants.DelimeterSinglePipe }).ToList());
                    ReferencesData = firstOrDefault.Referances.FirstOrDefault().WFCDesp == null ? new WFComponentSubs() : firstOrDefault.Referances;
                    SubLink        = firstOrDefault.Relation2;
                    uplForm.Update();
                }
                else
                {
                    GridViewTable.DataSource = stageMasters;
                    if (_newPageIndex >= 0)
                    {
                        GridViewTable.PageIndex = _newPageIndex;
                    }
                    GridViewTable.DataSource = stageMasters;
                    GridViewTable.DataBind();
                    UplView.Update();
                }
            }
        }
예제 #15
0
 public void BindAccessLevel(Designations designations)
 {
     GridViewTable.DataSource = designations;
     GridViewTable.DataBind();
     UplView.Update();
 }
예제 #16
0
 private void BindData(Locations locations)
 {
     GridViewTable.DataSource = locations;
     GridViewTable.DataBind();
     uplView.Update();
 }
예제 #17
0
 private void loadData(string sqlQuery)
 {
     GridViewTable.DataSource = new DbTools().GetDataTable(sqlQuery);
     GridViewTable.DataBind();
 }
예제 #18
0
 public void BindData(Units units)
 {
     GridViewTable.DataSource = units;
     GridViewTable.DataBind();
     uplView.Update();
 }
예제 #19
0
        //public string Keyword { get { return txtSearch.Text; } set { txtSearch.Text = value; } }
        #endregion

        public void BindData(BindType bindType)
        {
            var queryArgument = new QueryArgument(UserContext.DataBaseInfo)
            {
                FilterKey = UserCode.ToString(),
                BindType  = bindType,
                //Keyword = Keyword
            };
            var userProfiles = _controlPanel.GetUserProfiles(queryArgument);

            if (userProfiles != null)
            {
                if (bindType == BindType.Form)
                {
                    var objUserProfile = userProfiles.FirstOrDefault();
                    if (objUserProfile != null)
                    {
                        UserCode    = objUserProfile.UCode;
                        UserLoginId = objUserProfile.LoginId.Trim();
                        Password    = objUserProfile.Password.Trim();
                        UserName    = objUserProfile.Name.Trim();
                        //LastName=objUserProfile.
                        Address = objUserProfile.Address.Trim();
                        City    = objUserProfile.City.Trim();
                        Country = objUserProfile.Country.Trim();
                        var filter = new KeyValuePairItems
                        {
                            new KeyValuePairItem(Constants.filter1, Constants.CountryType),
                            new KeyValuePairItem(Constants.filter2, Country),
                            new KeyValuePairItem(Constants.DdldefaultText, Constants.DdlDefaultTextState),
                            new KeyValuePairItem(Constants.masterType, Constants.DdlCatHeaderData)
                        };
                        _genericClass.LoadDropDown(ddlState, filter, null, UserContext.DataBaseInfo);
                        State            = objUserProfile.State.Trim();
                        ZipCode          = objUserProfile.Zip.Trim();
                        Email            = objUserProfile.Email.Trim();
                        Mobile           = objUserProfile.Mobile.Trim();
                        ResidentialPhone = objUserProfile.ResPhone.Trim();
                        OfficePhone      = objUserProfile.OffPhone.Trim();
                        Dob        = objUserProfile.Dob.GetValueOrDefault();
                        EmployeeId = objUserProfile.EmpId.Trim();
                        Gender     = objUserProfile.Gender.Trim();
                        filter     = new KeyValuePairItems
                        {
                            new KeyValuePairItem(Constants.key, objUserProfile.UCode.ToString()),
                            new KeyValuePairItem(Constants.filter1, objUserProfile.Designation.Level.ToString(CultureInfo.InvariantCulture)),
                            new KeyValuePairItem(Constants.DdldefaultText, Constants.DdlDefaultTextRManager),
                            new KeyValuePairItem(Constants.masterType, Constants.DdlRManager)
                        };
                        _genericClass.LoadDropDown(ddlReporting, filter, null, UserContext.DataBaseInfo);
                        ReportingTo = objUserProfile.ReportingTo.ToString().Trim();
                        Warehouse   = objUserProfile.Wh.Trim();
                        Department  = objUserProfile.Dept.Trim();
                        Designation = objUserProfile.Designation.Id.Trim();
                        Avator      = objUserProfile.Avatar.Trim();
                        ActiveTill  = objUserProfile.ActiveTill.GetValueOrDefault();
                        Branch      = objUserProfile.Branch.Trim().Trim();
                        Bu          = objUserProfile.Bu.Trim();
                        Status      = objUserProfile.Off.Trim();
                    }
                    lnkSave.Visible = hidAction.Value != Constants.ViewAction;
                    uplForm.Update();
                }
                else
                {
                    var userProfile = userProfiles.ToList();
                    if (UserContext.UserProfile.Designation.Id.Trim() != "SA")
                    {
                        if (userProfiles.Any())
                        {
                            userProfile = userProfiles.Where(x => x.Designation.Id.Trim() != "SA").ToList();
                        }
                    }
                    GridViewTable.DataSource = userProfile;
                    GridViewTable.DataBind();
                    uplView.Update();
                }
            }
        }