예제 #1
0
        protected void OnGridRoomResultItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem dataItem      = e.Item as GridDataItem;
                int          postId        = ((Post)e.Item.DataItem).PostId;
                LinkButton   buttonDetails = dataItem["ViewDetails"].Controls[1] as LinkButton;
                if (buttonDetails != null)
                {
                    buttonDetails.OnClientClick = string.Format("return OnUserViewDetailsClientClicked('{0}')", postId);
                }


                LinkButton buttonDetailsNewTab = dataItem["ViewDetailsNewTab"].Controls[1] as LinkButton;
                if (buttonDetailsNewTab != null)
                {
                    buttonDetailsNewTab.OnClientClick = string.Format("return OnUserDetailsNewTabClientClicked('{0}')", postId);
                }
            }
        }
예제 #2
0
    protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        //Is it a GridDataItem
        if (e.Item is GridDataItem)
        {
            //Get the instance of the right type
            GridDataItem dataBoundItem = e.Item as GridDataItem;
            //if(dataBoundItem.GetDataKeyValue("ID").ToString() == "you Compared Text") // you can also use datakey also
            if (dataBoundItem["Status"].Text == "Open")
            {
                dataBoundItem["Status"].ForeColor = Color.Red;                // chanmge particuler cell
                e.Item.BackColor = System.Drawing.Color.LightGoldenrodYellow; // for whole row
                                                                              //dataItem.CssClass = "MyMexicoRowClass";
            }
            else if (dataBoundItem["Status"].Text == "Close")
            {
                dataBoundItem["Status"].ForeColor = Color.Green;   // chanmge particuler cell
                e.Item.BackColor = System.Drawing.Color.LightGray; // for whole row
                                                                   //dataItem.CssClass = "MyMexicoRowClass";
            }

            //Assign hyperlink
            GridDataItem item = (GridDataItem)e.Item;
            HyperLink    link = (HyperLink)item["View"].Controls[0];
            link.CssClass    = "hidelink";
            link.NavigateUrl = "UserTicketView.aspx?id=" + dataBoundItem["Ticket No"].Text;


            HyperLink linkUpdate = (HyperLink)item["updateLink"].Controls[0];
            linkUpdate.NavigateUrl = "Form_Edit_TicketDetails.aspx?id=" + dataBoundItem["Ticket No"].Text;

            if (dataBoundItem["Status"].Text == "Close")
            {
                linkUpdate.Visible = false;
            }
            else if (dataBoundItem["Status"].Text == "Open")
            {
                linkUpdate.Enabled = true;
            }
        }
    }
예제 #3
0
        private void GrdPErmisos_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if ((e.Item.ItemType == GridItemType.Item) || (e.Item.ItemType == GridItemType.AlternatingItem))
            {
                GridDataItem item = e.Item as GridDataItem;

                string ConsultarOp = item.GetDataKeyValue("Consultar").ToString();

                CheckBox Consultar;
                Consultar = (CheckBox)item.FindControl("ChkConsultar");
                if (ConsultarOp == "1")
                {
                    Consultar.Checked = true;
                }


                string   InsertarOp = item.GetDataKeyValue("Insertar").ToString();
                CheckBox Insertar;
                Insertar = (CheckBox)item.FindControl("ChkInsertar");
                if (InsertarOp == "1")
                {
                    Insertar.Checked = true;
                }

                string   EditarOp = item.GetDataKeyValue("Editar").ToString();
                CheckBox Editar;
                Editar = (CheckBox)item.FindControl("ChkEditar");
                if (EditarOp == "1")
                {
                    Editar.Checked = true;
                }

                string   EliminarOp = item.GetDataKeyValue("Eliminar").ToString();
                CheckBox Eliminar;
                Eliminar = (CheckBox)item.FindControl("ChkEliminar");
                if (EliminarOp == "1")
                {
                    Eliminar.Checked = true;
                }
            }
        }
예제 #4
0
        protected void rgDanhGia_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            Helper.PageHelper pageHelper = new Helper.PageHelper();
            pageHelper.SetSequenceNumberColumn(rgDanhGia, e, "lblSTT");

            if (e.Item is GridDataItem)
            {
                GridDataItem item       = e.Item as GridDataItem;
                HyperLink    hplNoiDung = item["DGNoiDung"].Controls[0] as HyperLink;

                if (!_quanly && !_loginACC.ACCUpLyLich)
                {
                    hplNoiDung.Enabled = false;
                }

                string tooltip = "- Nội dung đánh giá: " + hplNoiDung.Text;
                tooltip += ("\n- Ngày tháng đánh giá: " + item["DGNgay"].Text);

                hplNoiDung.ToolTip = tooltip;
            }
        }
예제 #5
0
    protected void rdgLevelD_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem griditem = e.Item as GridDataItem;
            if (griditem["ImgType"].Text.Equals("Soft Copy"))
            {
                griditem.BackColor = System.Drawing.Color.Yellow;
            }


            //if (!griditem["StatusCode"].Text.Equals("00") || !griditem["StatusCode"].Text.Equals("02") || !griditem["StatusCode"].Text.Equals("05"))
            //{
            if (!griditem["StatusCode"].Text.Equals("00"))
            {
                LinkButton lnk = (LinkButton)griditem.FindControl("lnkbtnBIR");
                lnk.Enabled   = false;
                lnk.ForeColor = System.Drawing.Color.Gray;
            }
        }
    }
예제 #6
0
    protected void grdTest_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridFilteringItem)
        {
            GridFilteringItem filterItem = (GridFilteringItem)e.Item;

            filterItem["CaseID"].HorizontalAlign = HorizontalAlign.Right;

            //LoadSubmitted();
        }


        if (e.Item is GridDataItem)
        {
            GridDataItem griditem = e.Item as GridDataItem;
            if (griditem["ImgType"].Text.Equals("Soft Copy"))
            {
                griditem.BackColor = System.Drawing.Color.Yellow;
            }
        }
    }
        //protected void EntityDataSource1_Selecting(object sender, EntityDataSourceSelectingEventArgs e)
        //{
        //    if (e.DataSource.Where != string.Empty)
        //    {
        //        e.DataSource.Where += " AND ";
        //    }

        //    e.DataSource.Where += "it.WorkflowInstanceID = Guid'" + this.ParentID.ToString() + "'";
        //}

        protected void TaskInstanceRadGrid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridEditFormItem)
            {
                var item = (GridEditFormItem)e.Item;
                //item["InsertDate"].Text = item["InsertDate"].Text.ToPersianDigit();
                //item["UpdateDate"].Text = item["UpdateDate"].Text.ToPersianDigit();
                var personalCardNo = item["InsertUser"].Text;
                var entity         = _entityManager.GetQuery(it => it.PersonalCardNo == personalCardNo).FirstOrDefault();
                item["InsertUser"].Text = (entity != null) ? entity.Title : "";
            }
            if (e.Item is GridDataItem)
            {
                var dataItem = (GridDataItem)e.Item;
                var dataitem = (dataItem["InsertDate"].FindControl("InsertDateLabel") as Label);
                dataitem.Text = dataitem.Text.ToPersianDigit();

                dataitem      = (dataItem["UpdateDate"].FindControl("UpdateDateLabel") as Label);
                dataitem.Text = dataitem.Text.ToPersianDigit();
            }
        }
        protected void rgUser_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item.IsInEditMode && hdfdataoperation.Value == "Edit")
            {
                var items = e.Item as GridEditableItem;
                if (items != null)
                {
                    var btn = items.FindControl("userlevel") as RadButton;

                    string val = items.GetDataKeyValue("USER_LEVEL").ToString();
                    //combobox.SelectedValue = val;
                    //if(val == "Admin")
                    //{
                    btn.SetSelectedToggleStateByText(val);
                    //}else
                    //{
                    //    btn.Checked = false;
                    //}
                }
            }
        }
예제 #9
0
        protected void rgProgramStaff_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item.ItemType == GridItemType.AlternatingItem || e.Item.ItemType == GridItemType.Item)
            {
                CheckBox chkStaff  = e.Item.FindControl("chkStaff") as CheckBox;
                CheckBox chkActive = e.Item.FindControl("chkActive") as CheckBox;

                DayCarePL.ProgStaffProperties objProgStaff = e.Item.DataItem as DayCarePL.ProgStaffProperties;
                if (objProgStaff != null)
                {
                    if (objProgStaff.Active)
                    {
                        chkStaff.Checked = true;
                    }
                    if (objProgStaff.Active == true)
                    {
                        chkActive.Checked = true;
                    }
                }
            }
        }
예제 #10
0
        protected void RadGridUnits_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                var item = e.Item as GridDataItem;

                if (item.ItemIndex > -1 && item.DataItem is UnitBO)
                {
                    UnitBO ObjUnit = (UnitBO)item.DataItem;

                    HyperLink linkEdit = (HyperLink)item.FindControl("linkEdit");
                    linkEdit.Attributes.Add("qid", ObjUnit.ID.ToString());

                    HyperLink linkDelete = (HyperLink)item.FindControl("linkDelete");
                    linkDelete.Attributes.Add("qid", ObjUnit.ID.ToString());
                    linkDelete.Visible = (ObjUnit.AccessorysWhereThisIsUnit.Count == 0 &&
                                          ObjUnit.FabricCodesWhereThisIsUnit.Count == 0 &&
                                          ObjUnit.PatternsWhereThisIsUnit.Count == 0) ? true : false;
                }
            }
        }
예제 #11
0
        protected void rgChinhSach_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            Helper.PageHelper pageHelper = new Helper.PageHelper();
            pageHelper.SetSequenceNumberColumn(rgChinhSach, e, "lblSTT");

            if (e.Item is GridDataItem)
            {
                GridDataItem item   = e.Item as GridDataItem;
                HyperLink    hplTen = item["CSTen"].Controls[0] as HyperLink;

                if (!_quanly && !_loginACC.ACCUpLyLich)
                {
                    hplTen.Enabled = false;
                }

                string tooltip = "- Diện chính sách: " + hplTen.Text;
                tooltip += ("\n- Ngày xét: " + item["CSNgay"].Text);

                hplTen.ToolTip = tooltip;
            }
        }
예제 #12
0
        protected void rdZona_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem oItem = e.Item as GridDataItem;
                (oItem["Editar"].Controls[0] as Button).CssClass   = "BtnColEditar";
                (oItem["Eliminar"].Controls[0] as Button).CssClass = "BtnColEliminar";

                if ((!string.IsNullOrEmpty(oItem["EstZona"].Text)) && (oItem["EstZona"].Text != " "))
                {
                    if (oItem["EstZona"].Text == "V")
                    {
                        oItem["EstZona"].Text = oCulture.GetResource("Zona", "Vigente");
                    }
                    else
                    {
                        oItem["EstZona"].Text = oCulture.GetResource("Zona", "NoVigente");
                    }
                }
            }
        }
        protected void rgProgClassCategory_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
            {
                DayCarePL.ProgClassCategoryProperties dataOfClassCategory = e.Item.DataItem as DayCarePL.ProgClassCategoryProperties;
                CheckBox chkAssign = e.Item.FindControl("Assign") as CheckBox;

                if (dataOfClassCategory != null)
                {
                    //if (!dataOfClassCategory.Assign.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                    if (dataOfClassCategory.Active == true)
                    {
                        chkAssign.Checked = true;
                    }
                    if (dataOfClassCategory.Assign.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                    {
                        chkAssign.Enabled = true;
                    }
                }
            }
        }
예제 #14
0
        //protected void gvCustomers_RowCommand(object sender, GridViewCommandEventArgs e)
        //{

        //    Random r = new Random();
        //    encryption = new OneWayEncryption();
        //    bool isSuccess = false;

        //    if (e.CommandName == "resetPassword")
        //    {
        //        int userId = int.Parse(e.CommandArgument.ToString());
        //        userVo = userBo.GetUserDetails(userId);
        //        if (userVo != null)
        //        {
        //            string hassedPassword = string.Empty;
        //            string saltValue = string.Empty;
        //            string password = r.Next(20000, 100000).ToString();

        //            userVo = userBo.GetUserDetails(userId);
        //            string userName = userVo.FirstName + " " + userVo.MiddleName + " " + userVo.LastName;
        //            encryption.GetHashAndSaltString(password, out hassedPassword, out saltValue);
        //            userVo.Password = hassedPassword;
        //            userVo.PasswordSaltValue = saltValue;
        //            userVo.OriginalPassword = password;
        //            userVo.IsTempPassword = 1;
        //            isSuccess = userBo.UpdateUser(userVo);
        //        }
        //        if (isSuccess)
        //        {
        //            //********************lblStatusMsg.Text = "Password has been reset.";
        //            tblMessage.Visible = true;
        //            SuccessMsg.Visible = true;
        //            SuccessMsg.InnerText = "Password has been reset.";
        //        }
        //        else
        //        {
        //            //************************lblStatusMsg.Text = "An error occurred while reseting password.";
        //            tblMessage.Visible = true;
        //            ErrorMessage.Visible = true;
        //            ErrorMessage.InnerText = "An error occurred while reseting password.";

        //        }
        //    }
        //    else if (e.CommandName == "GenerateLogin")
        //    {
        //        int userId = int.Parse(e.CommandArgument.ToString());
        //        string password = r.Next(20000, 100000).ToString();
        //        string hassedPassword;
        //        string saltValue;
        //        //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "leftpane", "loadcontrol('GenerateLoginPassword','?GenLoginPassword_UserId=" + userId + "');", true);
        //        userVo = userBo.GetUserDetails(userId);

        //        if (string.IsNullOrEmpty(userVo.LoginId))
        //        {
        //            userVo.LoginId = "Cu" + r.Next(100000, 999999).ToString();
        //            encryption.GetHashAndSaltString(password, out hassedPassword, out saltValue);
        //            userVo.Password = hassedPassword;
        //            userVo.PasswordSaltValue = saltValue;
        //            userVo.OriginalPassword = password;
        //            userVo.IsTempPassword = 1;
        //            userBo.UpdateUser(userVo);

        //        }
        //        SendMail(userVo, true);

        //        mypager.CurrentPage = int.Parse(hdnCurrentPage.Value.ToString());
        //        BindGrid();

        //    }
        //}

        //protected void btnNameSearch_Click(object sender, EventArgs e)
        //{
        //    TextBox txtName = GetCustNameTextBox();

        //    if (txtName != null)
        //    {
        //        hdnNameFilter.Value = txtName.Text.Trim();
        //        this.BindGrid();
        //    }
        //}

        //private TextBox GetCustNameTextBox()
        //{
        //    TextBox txt = new TextBox();
        //    if (gvCustomers.HeaderRow != null)
        //    {
        //        if ((TextBox)gvCustomers.HeaderRow.FindControl("txtCustNameSearch") != null)
        //        {
        //            txt = (TextBox)gvCustomers.HeaderRow.FindControl("txtCustNameSearch");
        //        }
        //    }
        //    else
        //        txt = null;

        //    return txt;
        //}

        protected void ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            //if (e.Row.RowType == DataControlRowType.DataRow)
            //{
            //    Label lblLoginId = e.Row.FindControl("lblLoginId") as Label;
            //    LinkButton lblGenerateLogin = e.Row.FindControl("lnkGenerateLogin") as LinkButton;
            //    LinkButton lnkResetPassword = e.Row.FindControl("lnkResetPassword") as LinkButton;
            //    CheckBox chkBox = e.Row.FindControl("chkId") as CheckBox;
            //    if (!string.IsNullOrEmpty(lblLoginId.Text.Trim()))
            //    {
            //        lblGenerateLogin.Visible = false;

            //    }
            //    else
            //    {
            //        lblLoginId.Visible = false;
            //        chkBox.Enabled = false;
            //        lnkResetPassword.Visible = false;
            //    }
            if (e.Item is GridDataItem)
            {
                GridDataItem item             = (GridDataItem)e.Item;
                Label        lblLoginId       = (Label)item.FindControl("lblLoginId");
                LinkButton   lblGenerateLogin = (LinkButton)item.FindControl("lnkGenerateLogin");
                //LinkButton lblGenerateLogin=e.Item.FindControl("lnkGenerateLogin") as LinkButton;
                //LinkButton lnkResetPassword =e.Item.FindControl("lnkResetPassword") as LinkButton;
                LinkButton lnkResetPassword = (LinkButton)item.FindControl("lnkResetPassword");
                CheckBox   chkBox           = e.Item.FindControl("cbRecons") as CheckBox;
                if (!string.IsNullOrEmpty(lblLoginId.Text.Trim()))
                {
                    lblGenerateLogin.Visible = false;
                }
                else
                {
                    lblLoginId.Visible       = false;
                    chkBox.Enabled           = false;
                    lnkResetPassword.Visible = false;
                }
            }
        }
예제 #15
0
    protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            ImageButton  imgb    = null;
            string       name    = "";
            string       command = "";
            GridDataItem gdi;
            int          id = 0;

            id = (int)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][e.Item.OwnerTableView.DataKeyNames[0]];

            // assign javascript function to select button
            imgb    = (ImageButton)e.Item.FindControl("Select");
            gdi     = (GridDataItem)e.Item;
            name    = gdi["Name"].Text;
            command = String.Format("return Selection('{0}','{1}','{2}','{3}','{4}');"
                                    , id.ToString()
                                    , null
                                    , name
                                    , null
                                    , "UserGroup");
            imgb.OnClientClick = command;
            if (type != "S")
            {
                imgb.Visible = false;              // not called from another form
            }
            // assign javascript function to edit button
            imgb               = (ImageButton)e.Item.FindControl("Edit");
            command            = String.Format("return EditProcessRecord({0});", id);
            imgb.OnClientClick = command;

            // assigning javascript functions to delete button
            imgb    = (ImageButton)e.Item.FindControl("Delete");
            command = String.Format("return radconfirm('{0}',event,300,100,'','{1}');"
                                    , Resources.GeneralResource.DeleteRecordQuestion + " " + name
                                    , Resources.GeneralResource.DeleteRecord);
            imgb.OnClientClick = command;
        }
    }
예제 #16
0
        protected void rGridTeam_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                //GridDataItem dataItem = e.Item as GridDataItem;
                int fieldValue = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "Points").ToString());
                totPointCount += fieldValue;

                RadBinaryImage rPrimPos = (RadBinaryImage)e.Item.FindControl("imgPrimPositon");
                RadBinaryImage rSecPos  = (RadBinaryImage)e.Item.FindControl("imgSecPositon");

                rPrimPos.ImageUrl = "~/Content/images/" + DataBinder.Eval(e.Item.DataItem, "PrimPos").ToString().Trim() + ".jpg";
                if (DataBinder.Eval(e.Item.DataItem, "SecPos") != null)
                {
                    rSecPos.ImageUrl = "~/Content/images/" + DataBinder.Eval(e.Item.DataItem, "SecPos").ToString().Trim() + ".jpg";
                }
                else
                {
                    rSecPos.Visible = false;
                }
            }
            if (e.Item is GridFooterItem)
            {
                GridFooterItem footerItem = e.Item as GridFooterItem;
                footerItem["Points"].Text = "total: " + totPointCount.ToString();
            }
            else if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                GridEditableItem edtItem     = (GridEditableItem)e.Item;
                Label            lblSeasonID = (Label)edtItem.FindControl("lblSeasonID");
                Label            lblTeamID   = (Label)edtItem.FindControl("lblTeamID");

                RadDropDownList rDDSeasonTeam = (RadDropDownList)edtItem.FindControl("rDDSeasonTeam");
                rDDSeasonTeam.DataSource     = SeasonTeamBLL.SeasonTeamOrder(Convert.ToInt32(lblSeasonID.Text));
                rDDSeasonTeam.DataValueField = "TeamID";
                rDDSeasonTeam.DataTextField  = "TeamName";
                rDDSeasonTeam.DataBind();
                rDDSeasonTeam.SelectedValue = lblTeamID.Text.ToString();
            }
        }
예제 #17
0
        protected void rgProgClassRoom_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item.ItemType == GridItemType.AlternatingItem || e.Item.ItemType == GridItemType.Item)
            {
                CheckBox chkClassRoom = e.Item.FindControl("chkClassRoom") as CheckBox;
                //CheckBox chkActive = e.Item.FindControl("chkActive") as CheckBox;
                //DropDownList ddlProgStaff = e.Item.FindControl("ddlProgStaff") as DropDownList;

                DayCarePL.ProgClassRoomProperties objProgClassRoom = e.Item.DataItem as DayCarePL.ProgClassRoomProperties;
                if (objProgClassRoom != null)
                {
                    //if (ddlProgStaff != null)
                    //{
                    //Guid SchoolId = new Guid();
                    //if (Session["SchoolId"] != null)
                    //{
                    //    SchoolId = new Guid(Session["SchoolId"].ToString());
                    //}
                    //if (ViewState["SchoolProgramId"] != null)
                    //{
                    //    Common.BindStaffFromProgStaff(ddlProgStaff, new Guid(ViewState["SchoolProgramId"].ToString()));
                    //}
                    if (objProgClassRoom.Active)
                    {
                        chkClassRoom.Checked = true;

                        //if (ddlProgStaff != null && ddlProgStaff.Items.Count > 0)
                        //{
                        //    ddlProgStaff.SelectedValue = Convert.ToString(objProgClassRoom.ProgStaffId);
                        //}
                    }
                    // }
                    //if (objProgStaff.Active == true)
                    //{
                    //    chkActive.Checked = true;
                    //}
                }
            }
        }
    protected void rg_appointments_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;

            if (item["Description"].Text != " ")
            {
                item["Description"].ToolTip  = item["Description"].Text;
                item["Description"].CssClass = "HandCursor";
                if (item["Description"].Text.Contains("Company: "))
                {
                    item["Description"].Text = item["Description"].Text.Substring(0, item["Description"].Text.IndexOf("Company: "));
                }
            }

            if (item["InPast"].Text == "1")
            {
                item.BackColor = System.Drawing.Color.FromName("#ffe6cc");
            }
        }
    }
예제 #19
0
        void grdDrivers_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridCommandItem)
            {
                HtmlInputButton btnAddDriver = e.Item.FindControl("btnAddDriver") as HtmlInputButton;
                btnAddDriver.Attributes.Add("onclick", dlgAddUpdateDriver.GetOpenDialogScript());

                if (Orchestrator.Globals.Configuration.FleetMetrikInstance)
                {
                    var btnSendDriverMessage = e.Item.FindControl("btnSendDriverMessage") as HtmlInputButton;
                    btnSendDriverMessage.Visible = false;
                }
            }
            else if (e.Item is GridDataItem)
            {
                CheckBox          clientSideSelectCheckBox = (e.Item as GridDataItem)["ClientSelectColumn"].Controls[0] as CheckBox;
                HtmlAnchor        hypViewDriver            = e.Item.FindControl("hypViewDriver") as HtmlAnchor;
                HtmlInputCheckBox chkAvailability          = e.Item.FindControl("chkAvailability") as HtmlInputCheckBox;
                Label             lblIsAgencyDriver        = e.Item.FindControl("lblIsAgencyDriver") as Label;
                HtmlAnchor        hypShowFuture            = e.Item.FindControl("hypShowFuture") as HtmlAnchor;

                DataRowView drv = (DataRowView)e.Item.DataItem;

                clientSideSelectCheckBox.Enabled = !string.IsNullOrWhiteSpace(drv["PassCode"].ToString());

                string availability = string.Format("javascript:SetAvailability('{0}', this);", drv["ResourceId"]);
                chkAvailability.Attributes.Add("onclick", availability);
                chkAvailability.Checked = drv["ResourceStatusId"].ToString() == "1" ? true : false;

                hypViewDriver.InnerText = drv["FullName"].ToString();
                hypViewDriver.HRef      = string.Format("javascript:{0}", dlgAddUpdateDriver.GetOpenDialogScript("identityId=" + drv["IdentityId"].ToString()));

                lblIsAgencyDriver.Text = ((bool)drv["IsAgencyDriver"]) ? "Yes" : "No";

                string date = DateTime.UtcNow.AddDays(-1).ToString("ddMMyyyy") + "0000";
                hypShowFuture.HRef      = string.Format("javascript:ShowFuture('{0}','3' ,'{1}');", drv["ResourceId"], date);
                hypShowFuture.InnerText = "Resource Future";
            }
        }
예제 #20
0
        protected void rgChildData_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item.ItemType == GridItemType.AlternatingItem || e.Item.ItemType == GridItemType.Item)
            {
                DayCarePL.ChildDataProperties objChildData = e.Item.DataItem as DayCarePL.ChildDataProperties;
                Image     imgChild = e.Item.FindControl("imgPhoto") as Image;
                HyperLink hlChildEnrollmentStatus = e.Item.FindControl("hlChildEnrollmentStatus") as HyperLink;
                HyperLink hlChildAbsentHistory    = e.Item.FindControl("hlChildAbsentHistory") as HyperLink;
                HyperLink hlChildSchedule         = e.Item.FindControl("hlChildSchedule") as HyperLink;

                if (!string.IsNullOrEmpty(objChildData.Photo))
                {
                    imgChild.ImageUrl = "../ChildImages/" + objChildData.Photo;
                }
                else
                {
                    if (objChildData.Gender == true)
                    {
                        imgChild.ImageUrl = "../ChildImages/boy.png";
                    }
                    else
                    {
                        imgChild.ImageUrl = "../ChildImages/girl.png";
                    }
                }

                hlChildEnrollmentStatus.NavigateUrl = "ChildEnrollmentStatus.aspx?Id=" + objChildData.Id;
                hlChildAbsentHistory.NavigateUrl    = "ChildAbsentHistory.aspx?Id=" + objChildData.Id;
                hlChildSchedule.NavigateUrl         = "ChildProgEnrollment.aspx?ChildDataId=" + objChildData.Id;
            }

            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
                RadUpload   upload      = userControl.FindControl("fupImage") as RadUpload;
                MasterAjaxManager = this.Page.Master.FindControl("RadAjaxManager1") as Telerik.Web.UI.RadAjaxManager;
                MasterAjaxManager.ResponseScripts.Add(string.Format("window['UploadId'] = '{0}';", upload.ClientID));
            }
        }
예제 #21
0
        protected void rgTrinhDoTinHoc_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            Helper.PageHelper pageHelper = new Helper.PageHelper();
            pageHelper.SetSequenceNumberColumn(rgTrinhDoTinHoc, e, "lblSTT");

            if (e.Item is GridDataItem)
            {
                GridDataItem item = e.Item as GridDataItem;

                HyperLink hplTen = item["TDTHTen"].Controls[0] as HyperLink;

                if (!_quanly && !_loginACC.ACCUpLyLich)
                {
                    hplTen.Enabled = false;
                }

                string tooltip = ("- Trình độ tin học: " + hplTen.Text);
                tooltip += ("\n- Bằng cấp: " + item["TDTHChungChi"].Text);

                hplTen.ToolTip = tooltip;
            }
        }
예제 #22
0
 protected void rgTickets_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
 {
     //Is it a GridDataItem
     if (e.Item is GridDataItem)
     {
         //Get the instance of the right type
         GridDataItem dataBoundItem = e.Item as GridDataItem;
         //if(dataBoundItem.GetDataKeyValue("ID").ToString() == "you Compared Text") // you can also use datakey also
         if (dataBoundItem["Status"].Text == "Open")
         {
             dataBoundItem["Status"].ForeColor = Color.Red;                // chanmge particuler cell
             e.Item.BackColor = System.Drawing.Color.LightGoldenrodYellow; // for whole row
             //dataItem.CssClass = "MyMexicoRowClass";
         }
         else if (dataBoundItem["Status"].Text == "Close")
         {
             dataBoundItem["Status"].ForeColor = Color.Green;   // chanmge particuler cell
             e.Item.BackColor = System.Drawing.Color.LightGray; // for whole row
             //dataItem.CssClass = "MyMexicoRowClass";
         }
     }
 }
예제 #23
0
        protected void PayGrid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem item = (GridDataItem)e.Item;
                TableCell    cell = (TableCell)item["AppStatus"];

                Button btn = e.Item.FindControl("btn_ConfirmPay") as Button;
                if (cell.Text == "بازگشت داده شده")
                {
                    btn.Enabled   = true;
                    btn.BackColor = Color.DarkSeaGreen;
                    btn.ForeColor = Color.White;
                }
                else
                {
                    btn.Enabled   = false;
                    btn.BackColor = Color.Wheat;
                    btn.ForeColor = Color.Black;
                }
            }
        }