Inheritance: MasterPage
Example #1
0
 protected void HideMessages()
 {
     if (SiteMaster != null)
     {
         SiteMaster.HideWarningText();
     }
 }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        recId = int.Parse(Request.QueryString["recNum"].ToString());
        if (!Page.IsPostBack)
        {
            var t = (from j in ad.tblLogonIds
                     where j.Id == recId
                     select j).Single();
            txtUser.Text  = t.UserName;
            txtEmail.Text = t.emailAddress;
            txtRole.Text  = t.Role.ToString();
        }


        if (Session["Role"].ToString() == "1")
        {
            SiteMaster master = (SiteMaster)this.Master;
            Menu       mnu    = ((Menu)master.FindControl("NavigationMenu"));
            MenuItem   item   = new MenuItem("Admin Console");
            for (int k = 0; k < mnu.Items.Count; k++)
            {
                if (mnu.Items[k].Value == item.Text)
                {  //Don't add
                    continue;
                }
                else
                {
                    //mnu.Items.Add(item);
                }
            }
        }
    }
Example #3
0
        protected void btnApprove_Click(object sender, EventArgs e)
        {
            string strPreYrLv = "";

            personTable = ViewState["dt"] as DataTable;
            DataTable dtLeaveApp = new DataTable();

            dtLeaveApp = objLeaveMgr.SelectRequestLeaveAppMst(Convert.ToInt32(personTable.Rows[0]["LvAppID"].ToString().Trim()), personTable.Rows[0]["EmpId"].ToString().Trim(), "", Common.ReturnDateTimeInString(Common.DisplayDateTime(personTable.Rows[0]["LeaveStart"].ToString().Trim(), false, Constant.strDateFormat), false, Constant.strDateFormat), Common.ReturnDateTimeInString(Common.DisplayDateTime(personTable.Rows[0]["LeaveEnd"].ToString().Trim(), false, Constant.strDateFormat), false, Constant.strDateFormat), "");
            if (dtLeaveApp.Rows.Count > 0)
            {
                this.AvailableLeave("A", dtLeaveApp.Rows[0]["EmpId"].ToString().Trim(), dtLeaveApp.Rows[0]["LTypeId"].ToString().Trim(), dtLeaveApp.Rows[0]["LDurInDays"].ToString().Trim());
                this.GetLeaveDates(dtLeaveApp.Rows[0]["LvAppID"].ToString().Trim(), "A", dtLeaveApp.Rows[0]["LeaveStart"].ToString().Trim(), dtLeaveApp.Rows[0]["LeaveEnd"].ToString().Trim());

                objLeaveMgr.UpdateLeaveAppMstForApprove(dtLeaveApp.Rows[0]["LvAppID"].ToString().Trim(),
                                                        dtLeaveApp.Rows[0]["EmpId"].ToString().Trim(), "Y", "N", "A", hfLEnjoyed.Value.ToString(), hfLDates.Value.ToString(), dtLeaveApp.Rows[0]["LAbbrName"].ToString().Trim(),
                                                        dtLeaveApp.Rows[0]["LTypeId"].ToString().Trim(), dtLeaveApp.Rows[0]["LTReason"].ToString().Trim(),
                                                        Session["USERID"].ToString(), Common.ReturnDateTimeInString(Common.DisplayDateTime(DateTime.Now.ToString(), false, Constant.strDateFormat), false, Constant.strDateFormat), strPreYrLv, dtLeaveApp.Rows[0]["LDurInDays"].ToString().Trim());

                ScriptManager.RegisterClientScriptBlock(Page, typeof(string), Guid.NewGuid().ToString(), "ReLoadPreviousPage();", true);
                SiteMaster.ShowClientMessage(Page, "Leave has been approved successfully.", "success");
                ScriptManager.RegisterClientScriptBlock(Page, typeof(string), Guid.NewGuid().ToString(), "CloseWindow(3200);", true);
            }
            else
            {
                SiteMaster.ShowClientMessage(Page, "No Leave Information to Approve.", "warn");
            }
        }
Example #4
0
        protected bool ValidateAndSave(string cmdType)
        {
            double totalShare = 0;

            //For Death beneficiary checking. Total share amount <=100%.
            if (cblNomTypeList.Items.FindByValue("D").Selected == true)
            {
                if ((txtShare.Text.Trim() == string.Empty || double.Parse(txtShare.Text.Trim()) <= 0))
                {
                    SiteMaster.ShowClientMessage(Page, "Please enter valid share amount.", "error");
                    return(false);
                }
                else
                {
                    for (int i = 0; i < grList.Rows.Count; i++)
                    {
                        totalShare += double.Parse(grList.DataKeys[i].Values[8].ToString().Trim());
                    }
                    if (cmdType == "U")
                    {
                        totalShare -= double.Parse(ViewState["SelectShareAmt"].ToString().Trim());
                    }
                    if (totalShare + double.Parse(txtShare.Text.Trim()) > 100)
                    {
                        txtShare.Text = (100 - totalShare).ToString();
                        SiteMaster.ShowClientMessage(Page, "Total share amount is over limit.", "error");
                        return(false);
                    }
                }
            }

            return(true);
        }
Example #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         SiteMaster.SetTituloPagina("Consulta de inventarios");
     }
 }
Example #6
0
        protected void Page_Init(object sender, EventArgs e)
        {
            if ((RouteData.Values["Catalog"]?.ToString() ?? string.Empty) == "Catalog")
            {
                var user = (SiteMaster.CurrentUser());
                if (user == null)
                {
                    return;
                }
                _messages            = LogicCollection.PostLogic.GetMediaPostsByUser(user);
                SearchBox.Visible    = false;
                SearchButton.Visible = false;
                CreatePost.Visible   = false;
                Title = "Catalogus";

                warning.Visible = !_messages.Any();
            }
            else
            {
                var searchQuery = Request.QueryString["q"];

                if (searchQuery == null)
                {
                    _messages = LogicCollection.PostLogic.GetAllMainPosts();
                }
                else
                {
                    _messages      = LogicCollection.PostLogic.SearchPostsByHashtag(searchQuery);
                    SearchBox.Text = searchQuery;
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         SiteMaster.SetTituloPagina("Consulta de devoluciones de producto");
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         SiteMaster.SetTituloPagina(@"Usuarios del sistema");
     }
 }
        protected void Page_Init(object sender, EventArgs e)
        {
            SiteMaster m = Master as SiteMaster;

            m.Title    = "Project Reports";
            m.SubTitle = "project briefs and reports";
        }
Example #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     master     = Page.Master as SiteMaster;
     user       = Request.QueryString["user"];
     playerPage = master.GetPlayer(user);
     setUp();
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         SiteMaster.SetTituloPagina("Municipios");
     }
 }
        protected bool ValidateAndSave()
        {
            if (string.IsNullOrEmpty(txtUserId.Text) == false)
            {
                string      password    = txtOldPass.Text.ToString();
                string      strInputPwd = Common.getHashValue(password);
                DataTable   dtUser      = new DataTable();
                UserManager objUserMgr  = new UserManager();
                dtUser = objUserMgr.SelectUserInfo(txtUserId.Text.Trim(), "Y");

                if (dtUser.Rows.Count > 0)
                {
                    foreach (DataRow row in dtUser.Rows)
                    {
                        if (string.Compare(row["Password"].ToString().Trim(), strInputPwd) != 0)
                        {
                            SiteMaster.ShowClientMessage(Page, "Old Password is not valid. Please check the password.", "error");
                            txtOldPass.Focus();
                            return(false);
                        }
                    }
                }

                if (string.Compare(Common.getHashValue(txtNewPass.Text.Trim()), Common.getHashValue(txtConfNewPass.Text.Trim())) != 0)
                {
                    SiteMaster.ShowClientMessage(Page, "New Password fields dont match with each other.", "error");
                    txtNewPass.Focus();
                    return(false);
                }
            }
            return(true);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            SiteMaster m = Master as SiteMaster;

            m.Title    = "Report Contents";
            m.SubTitle = "report sections and details";
        }
Example #14
0
        protected void grRecommendTravelList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            GridView _gridView = (GridView)sender;
            // Get the selected index and the command name
            int    _selectedIndex = int.Parse(e.CommandArgument.ToString());
            string _commandName   = e.CommandName;

            _gridView.SelectedIndex = _selectedIndex;
            //string strPreYrLv = "";
            switch (_commandName)
            {
            case ("ViewClick"):
                GenerateReport(grRecommendTravelList.DataKeys[_gridView.SelectedIndex].Values[0].ToString().Trim(), grRecommendTravelList.DataKeys[_gridView.SelectedIndex].Values[10].ToString().Trim(), grRecommendTravelList.DataKeys[_gridView.SelectedIndex].Values[13].ToString().Trim());
                break;

            case ("RecommendClick"):
                UpdateTravel(grRecommendTravelList.DataKeys[_gridView.SelectedIndex].Values[0].ToString().Trim(), grRecommendTravelList.DataKeys[_gridView.SelectedIndex].Values[10].ToString().Trim(), "R");
                SiteMaster.ShowClientMessage(Page, "Travel has been Recommended Successfully.", "success");
                break;

            case ("CancelClick"):

                SiteMaster.ShowClientMessage(Page, "Leave has been Cancelled Successfully.", "success");
                break;
            }

            this.OpenRecord();
            //strPreYrLv = "";
        }
Example #15
0
        protected void txtApproveBy_TextChanged(object sender, EventArgs e)
        {
            TextBox     txtApproveBy = (TextBox)sender;
            GridViewRow row          = (GridViewRow)txtApproveBy.Parent.Parent;
            GridView    _gridView    = (GridView)row.Parent.Parent;
            var         tt           = _gridView.Rows[row.RowIndex].Cells[3];

            if (txtApproveBy.Text.Trim() == string.Empty)
            {
                SiteMaster.ShowClientMessage(Page, "Please Enter Approver ID.", "error");
                hdfApproveBy.Value = "";
                return;
            }

            DataTable dtApproval = objEmpInfoMgr.SelectEmpInfoHRAction(txtApproveBy.Text.Trim());

            if (dtApproval.Rows.Count == 0)
            {
                SiteMaster.ShowClientMessage(Page, "Approver ID is Invalid.", "error");
                txtApproveBy.Text  = "";
                hdfApproveBy.Value = "";
                return;
            }
            else
            {
                TextBox txtName = (TextBox)_gridView.Rows[row.RowIndex].Cells[3].FindControl("txtApproveByName");
                txtName.Text       = dtApproval.Rows[0]["FullName"].ToString().Trim();
                hdfApproveBy.Value = txtApproveBy.Text.Trim();
            }
        }
Example #16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         SiteMaster.SetTituloPagina("Facturar producto");
     }
 }
Example #17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!SiteMaster.CurrentUser().Admin)
     {
         // If not admin NOT AUTHORIZED
         Response.Redirect("Login.aspx");
     }
 }
Example #18
0
 protected override void Page_Load(object sender, EventArgs e)
 {
     base.Page_Load(sender, e);
     if (!Page.IsPostBack)
     {
         SiteMaster.SetTituloPagina("Perfil de usuario");
     }
 }
Example #19
0
 protected bool doesGroupExist(string groupName)
 {
     if (String.IsNullOrWhiteSpace((string)Session["currentAgency"]))
     {
         return(false);
     }
     return(Convert.ToBoolean(SiteMaster.getSingleSQLData(" select case \n   when exists (SELECT DISTINCT name FROM " + Session["currentAgency"] + ".sys.schemas WHERE name = '" + groupName + "') \n   then 1 \n   else 0 \n end")));
 }
Example #20
0
 protected void HideErrors()
 {
     if (SiteMaster != null)
     {
         SiteMaster.HideErrorText();
         SiteMaster.HideWarningText();
     }
 }
Example #21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Page.Title = "TimeKeeper Pro&#xA9 | Details";
        SiteMaster mast = (SiteMaster)this.Master;
        Menu       mnu  = ((Menu)mast.FindControl("NavigationMenu"));

        mnu.Visible = false;
        LoadData();
    }
Example #22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     master             = (SiteMaster)Page.Master;
     hdfShowModal.Value = "0";
     if (!Page.IsPostBack)
     {
         LoadUsers();
     }
 }
Example #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            FaceBookConnect.API_Key    = "2242043896069687";                 //2242043896069687
            FaceBookConnect.API_Secret = "a9d7e59646b9d0f1a1c289f26adfb04d"; //4d893911bebc078d14578a765e685727
            if (!IsPostBack)
            {
                if (Request.QueryString["error"] == "access_denied")
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('User has denied access.')", true);
                    return;
                }

                string code = Request.QueryString["code"];
                if (!string.IsNullOrEmpty(code))
                {
                    string       data         = FaceBookConnect.Fetch(code, "me?fields=id,name,email");
                    FaceBookUser faceBookUser = new JavaScriptSerializer().Deserialize <FaceBookUser>(data);
                    faceBookUser.PictureUrl = string.Format("https://graph.facebook.com/{0}/picture", faceBookUser.Id);
                    pnlFaceBookUser.Visible = true;

                    txtUsuario.Text = faceBookUser.Email;
                    // txtPassword.Text = faceBookUser.

                    LoUsuario objLo = new LoUsuario();
                    EnUsuario objEn = new EnUsuario();

                    objEn.Clave  = faceBookUser.Id;
                    objEn.Name   = faceBookUser.UserName;
                    objEn.Correo = faceBookUser.Email;

                    Session["UsuarioImg"] = faceBookUser.PictureUrl;

                    var miMaster = (SiteMaster)Master;

                    SiteMaster master = (SiteMaster)this.Master;
                    master.UsuarioLogin(faceBookUser.PictureUrl);

                    DataTable dt = new DataTable();
                    dt = objLo.Usuarios_Listar(objEn);

                    if (dt.Rows.Count < 1)
                    {
                        string msg = string.Empty;
                        msg = objLo.Usuarios_Insertar(objEn);
                    }

                    Response.Redirect("/Device/NewDevice.aspx");

                    //lblId.Text = faceBookUser.Id;
                    //lblUserName.Text = faceBookUser.UserName;
                    //lblName.Text = faceBookUser.Name;
                    //lblEmail.Text = faceBookUser.Email;
                    //ProfileImage.ImageUrl = faceBookUser.PictureUrl;
                }
            }
        }
Example #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var user = SiteMaster.CurrentUser();

            if (user != null)
            {
                lblNotLoggedIn.Visible = true;
                lblNotLoggedIn.Text    = "Je bent al ingelogd.";
                loginForm.Visible      = false;
            }
        }
        protected void grTravelApp_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            MailManagerSmtpClient objMail = new MailManagerSmtpClient();
            string   mailMessage          = "";
            GridView _gridView            = (GridView)sender;
            // Get the selected index and the command name
            int    _selectedIndex = int.Parse(e.CommandArgument.ToString());
            string _commandName   = e.CommandName;

            _gridView.SelectedIndex = _selectedIndex;
            char[]   splitter   = { ',' };
            string[] arinfo2    = new string[10];
            string   leaveStart = "";
            string   leaveEnd   = "";

            switch (_commandName)
            {
            case ("ViewClick"):
                GenerateReport(grTravelList.DataKeys[_gridView.SelectedIndex].Values[0].ToString().Trim(), grTravelList.DataKeys[_gridView.SelectedIndex].Values[10].ToString().Trim(), grTravelList.DataKeys[_gridView.SelectedIndex].Values[13].ToString().Trim());
                break;

            case ("ApproveClick"):
                this.GetTravelDates(grTravelList.DataKeys[_gridView.SelectedIndex].Values[0].ToString(), "A", grTravelList.DataKeys[_gridView.SelectedIndex].Values[4].ToString(), grTravelList.DataKeys[_gridView.SelectedIndex].Values[5].ToString());
                UpdateTravel(grTravelList.DataKeys[_gridView.SelectedIndex].Values[0].ToString().Trim(), grTravelList.DataKeys[_gridView.SelectedIndex].Values[10].ToString().Trim(), "A", hfLDates.Value);

                //Email Notification
                SiteMaster.ShowClientMessage(Page, "Leave has been approved successfully", "success");
                break;

            case ("DenyClick"):
                //objLeaveMgr.UpdateLeaveAppMstForDeny(grTravelList.DataKeys[_gridView.SelectedIndex].Values[0].ToString(),
                //    grTravelList.DataKeys[_gridView.SelectedIndex].Values[11].ToString().Trim(), "Y", "N", "D",
                //    Session["USERID"].ToString(), Common.ReturnDateTimeInString(Common.DisplayDateTime(DateTime.Now.ToString(), false, Constant.strDateFormat), false,Constant.strDateFormat));

                mailMessage = objMail.LeaveMail(grTravelList.DataKeys[_gridView.SelectedIndex].Values[11].ToString(), grTravelList.DataKeys[_gridView.SelectedIndex].Values[0].ToString(),
                                                Session["EMPID"].ToString(), leaveStart, leaveEnd, "D");
                SiteMaster.ShowClientMessage(Page, "Leave has been Regreted Successfully.", "success");
                break;

            case ("CancelClick"):
                //objLeaveMgr.CancelLeaveApp(grTravelList.DataKeys[_gridView.SelectedIndex].Values[0].ToString(),
                //    grTravelList.DataKeys[_gridView.SelectedIndex].Values[11].ToString().Trim(), "Y", "N", "C",
                //    Session["USERID"].ToString(), Common.ReturnDateTimeInString(Common.DisplayDateTime( DateTime.Now.ToString(), false, Constant.strDateFormat), false,Constant.strDateFormat));

                mailMessage = objMail.LeaveMail(grTravelList.DataKeys[_gridView.SelectedIndex].Values[11].ToString(), grTravelList.DataKeys[_gridView.SelectedIndex].Values[0].ToString(),
                                                Session["EMPID"].ToString(), leaveStart, leaveEnd, "C");

                SiteMaster.ShowClientMessage(Page, "Leave has been Cancelled Successfully.", "success");
                break;
            }

            this.OpenRecord();
        }
Example #26
0
    protected void Page_Init(object sender, EventArgs e)
    {
        SiteMaster myMaster    = (SiteMaster)this.Master;
        SiteMaster MyMasterObj = (SiteMaster)this.Master;
        Menu       mnu         = ((Menu)MyMasterObj.FindControl("NavigationMenu"));
        LinkButton lnk         = ((LinkButton)MyMasterObj.FindControl("LinkButton1"));
        Label      lbl         = ((Label)MyMasterObj.FindControl("lblVersion"));

        mnu.Visible = false;
        lnk.Visible = false;
        lbl.Visible = false;
    }
        //protected void btnEmpSearch_Click(object sender, EventArgs e)
        //{
        //    if (Session["ISADMIN"].ToString().Trim() == "Y")
        //    {
        //        this.GetSearchResult();
        //    }
        //}
        //private void OpenRecord()
        //{
        //    DataTable dtEmpLvProfile = objLeave.SelectEmpLeaveProfileEXCPL(txtEmpID.Text.Trim(), "0", hdfGender.Value.ToString());
        //    if (dtEmpLvProfile.Rows.Count > 0)
        //    {
        //        grLeaveStatus.DataSource = dtEmpLvProfile;
        //        grLeaveStatus.DataBind();
        //        this.FormatLeaveStatusGridNumber();
        //        this.GetLeaveYearDates(dtEmpLvProfile);
        //    }
        //}
        //protected void GetLeaveYearDates(DataTable dt)
        //{
        //    if (dt.Rows.Count > 0)
        //    {
        //        if (string.IsNullOrEmpty(dt.Rows[0]["LeaveStartPeriod"].ToString()) == false)
        //        {
        //            hdfLvPackStartDate.Value = dt.Rows[0]["LeaveStartPeriod"].ToString();
        //            hdfLvPackEndDate.Value = dt.Rows[0]["LeaveEndPeriod"].ToString();
        //        }
        //        else
        //        {
        //            hdfLvPackStartDate.Value = Common.ReturnDateTimeInString(dt.Rows[0]["JoiningDate"].ToString(), false, Constant.strDateFormat);
        //            if (string.IsNullOrEmpty(dt.Rows[0]["SeparateDate"].ToString()) == false)
        //                hdfLvPackEndDate.Value = Common.ReturnDateTimeInString(dt.Rows[0]["SeparateDate"].ToString(), false, Constant.strDateFormat);
        //        }
        //    }
        //}
        //protected void FormatLeaveStatusGridNumber()
        //{
        //    int i = 0;
        //    foreach (GridViewRow gRow in grLeaveStatus.Rows)
        //    {
        //        gRow.Cells[1].Text = Convert.ToString(Math.Round(Convert.ToDouble(Common.ReturnZeroForNull(gRow.Cells[1].Text)), 1));
        //        gRow.Cells[2].Text = Convert.ToString(Math.Round(Convert.ToDouble(Common.ReturnZeroForNull(gRow.Cells[2].Text)), 1));
        //        gRow.Cells[3].Text = Convert.ToString(Math.Round(Convert.ToDouble(Common.ReturnZeroForNull(gRow.Cells[3].Text)), 1));
        //        gRow.Cells[4].Text = Convert.ToString(Math.Round(Convert.ToDouble(Common.ReturnZeroForNull(gRow.Cells[2].Text)) + Convert.ToDouble(Common.ReturnZeroForNull(gRow.Cells[3].Text)), 1));
        //        gRow.Cells[5].Text = Convert.ToString(Math.Round(Convert.ToDouble(Common.ReturnZeroForNull(gRow.Cells[5].Text)), 1) + Convert.ToDouble(grLeaveStatus.DataKeys[i].Values[8].ToString().Trim() == "" ? "0" : grLeaveStatus.DataKeys[i].Values[8].ToString().Trim()));
        //        gRow.Cells[6].Text = Convert.ToString(Math.Round(Convert.ToDouble(Common.ReturnZeroForNull(gRow.Cells[4].Text)) + Math.Round(Convert.ToDouble(Common.ReturnZeroForNull(gRow.Cells[1].Text))) - Convert.ToDouble(Common.ReturnZeroForNull(gRow.Cells[5].Text)), 1));

        //        if (Convert.ToDecimal(gRow.Cells[6].Text) < 0)
        //        {
        //            gRow.Cells[6].Text = "0";
        //        }
        //        i++;
        //    }
        //}
        protected void ddlTravelMode_SelectedIndexChanged(object sender, EventArgs e)
        {
            double   TotDay = 0;
            DateTime dtFrom = new DateTime();
            DateTime dtTo   = new DateTime();

            if (string.IsNullOrEmpty(dtpTravelStart.Text) == true)
            {
                SiteMaster.ShowClientMessage(Page, "Please Insert Valid From Date!", "error");
                return;
            }
            if (string.IsNullOrEmpty(dtpTravelEnd.Text) == true)
            {
                SiteMaster.ShowClientMessage(Page, "Please Insert Valid To Date!", "error");
                return;
            }
            if (string.IsNullOrEmpty(dtpResumeDate.Text) == true)
            {
                SiteMaster.ShowClientMessage(Page, "Please Insert Valid Office Resume Date!", "error");
                return;
            }

            if (string.IsNullOrEmpty(dtpTravelEnd.Text) == false && string.IsNullOrEmpty(dtpTravelStart.Text) == false)
            {
                char[]   splitter = { '/' };
                string[] arinfo   = Common.str_split(dtpTravelStart.Text.Trim(), splitter);
                if (arinfo.Length == 3)
                {
                    dtFrom = Convert.ToDateTime(arinfo[2] + "/" + arinfo[1] + "/" + arinfo[0]);
                    arinfo = null;
                    //SiteMaster.ShowClientMessage(Page, "Pass: dtFrom()", "error");
                }
                arinfo = Common.str_split(dtpTravelEnd.Text.Trim(), splitter);

                if (arinfo.Length == 3)
                {
                    dtTo   = Convert.ToDateTime(arinfo[2] + "/" + arinfo[1] + "/" + arinfo[0]);
                    arinfo = null;
                    //SiteMaster.ShowClientMessage(Page, "Pass: dtTo()", "error");
                }

                TimeSpan Dur = dtTo.Subtract(dtFrom);

                TotDay = Math.Round(Convert.ToDouble(Dur.Days), 0) + 1;
                if (TotDay < 0)
                {
                    SiteMaster.ShowClientMessage(Page, "From Date Cannot Be Greater Than To Date!", "error");
                    return;
                }
            }
            txtTotalDays.Text = TotDay.ToString();
        }
Example #28
0
 protected void Page_Load(object sender, EventArgs e)
 {
     // SelectCommand
     SqlDataSource1.SelectCommand =
         "SELECT Jeux.Nom AS Nom, Jeux.Description AS Description, Jeux.PEGI AS PEGI, SUM(Votes.count) AS Hits, Jeux.Status AS Status, " +
         "       ROUND(AVG(Votes.cote), 2, 1) AS Cote, Jeux.id AS id, utilisateurs.Nom AS Editeur, Jeux.Categorie AS CategorieID, Categories.Nom AS Categorie " +
         "FROM Jeux  " +
         "LEFT JOIN Categories ON Categories.id = Jeux.Categorie  " +
         "LEFT JOIN utilisateurs ON utilisateurs.id = Jeux.Editeur  " +
         "LEFT JOIN Votes ON Votes.idJeu = Jeux.id " +
         "WHERE Jeux.Editeur = " + SiteMaster.getUserId() + " " +
         "GROUP BY Jeux.id, Jeux.Description, Jeux.Nom, Jeux.PEGI, utilisateurs.Nom, Categories.Nom, Jeux.Categorie, Jeux.Status";
 }
Example #29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            master = Page.Master as SiteMaster;

            if (String.IsNullOrEmpty(Request.QueryString["user"]))
            {
                pagePlayer = master.GetPlayer(Context.User.Identity.Name);
            }
            else
            {
                pagePlayer = master.GetPlayer(Request.QueryString["user"]);
            }
        }
Example #30
0
        //// GET: SiteMaster/Details/5
        //public ActionResult Details(int? id)
        //{
        //    if (id == null)
        //    {
        //        return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
        //    }
        //    SiteMaster siteMaster = db.SiteMasters.Find(id);
        //    if (siteMaster == null)
        //    {
        //        return HttpNotFound();
        //    }
        //    return View(siteMaster);
        //}

        //// GET: SiteMaster/Create
        //public ActionResult Create()
        //{
        //    return View();
        //}

        //// POST: SiteMaster/Create
        //// To protect from overposting attacks, please enable the specific properties you want to bind to, for
        //// more details see https://go.microsoft.com/fwlink/?LinkId=317598.
        //[HttpPost]
        //[ValidateAntiForgeryToken]
        //public ActionResult Create([Bind(Include = "Id,BUCode,BUDescription,WorkingHour,GracePeriod")] SiteMaster siteMaster)
        //{
        //    if (ModelState.IsValid)
        //    {
        //        db.SiteMasters.Add(siteMaster);
        //        db.SaveChanges();
        //        return RedirectToAction("Index");
        //    }

        //    return View(siteMaster);
        //}

        // GET: SiteMaster/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SiteMaster siteMaster = db.SiteMasters.Find(id);

            if (siteMaster == null)
            {
                return(HttpNotFound());
            }
            return(View(siteMaster));
        }
Example #31
0
 protected void Page_Load(object sender, EventArgs e)
 {
     siteMaster = (SiteMaster)Master;
     dba = DataBaseAccess.getInstance();
     RegisterHyperLink.NavigateUrl = "Register.aspx?ReturnUrl=" + HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
 }