Exemple #1
0
    /// <summary>
    /// DataList控件绑定及分页
    /// </summary>
    /// <param name="intCount">每页显示的记录条数</param>
    /// <param name="ds">DataSet数据集</param>
    /// <param name="labPage">当前页码</param>
    /// <param name="labTPage">总页码</param>
    /// <param name="lbtnUp">上一页</param>
    /// <param name="lbtnNext">下一页</param>
    /// <param name="lbtnBack">最后一页</param>
    /// <param name="lbtnOne">第一页</param>
    /// <param name="dl">DataList控件对象</param>
    public static void dlBind(int intCount, DataSet ds, Label labPage, Label labTPage, LinkButton lbtnUp, LinkButton lbtnNext, LinkButton lbtnBack, LinkButton lbtnOne, Repeater dl)
    {
        int curpage = Convert.ToInt32(labPage.Text);
        PagedDataSource ps = new PagedDataSource();
        ps.DataSource = ds.Tables[0].DefaultView;
        ps.AllowPaging = true; //是否可以分页
        ps.PageSize = intCount; //显示的数量
        ps.CurrentPageIndex = curpage - 1; //取得当前页的页码

        lbtnNext.Visible = true;
        lbtnOne.Visible = true;
        lbtnBack.Visible = true;
        lbtnUp.Visible = true;

        lbtnNext.Enabled = true;
        lbtnBack.Enabled = true;
        lbtnOne.Enabled = true;
        if (curpage == 1)
        {
            lbtnOne.Visible = false;//不显示第一页按钮
            lbtnUp.Visible = false;//不显示上一页按钮
        }
        if (curpage == ps.PageCount)
        {
            lbtnNext.Visible = false;//不显示下一页
            lbtnBack.Visible = false;//不显示最后一页
        }
        labTPage.Text = Convert.ToString(ps.PageCount);
        dl.DataSource = ps;
           // dl.DataKeyField = "ID";
        dl.DataBind();
    }
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     LinkButton linkButton = new LinkButton();
     linkButton = (LinkButton)sender;
     bool result = ACC_JournalMasterManager.DeleteACC_JournalMaster(Convert.ToInt32(linkButton.CommandArgument));
     showACC_JournalMasterGrid();
 }
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     LinkButton linkButton = new LinkButton();
     linkButton = (LinkButton)sender;
     bool result = Inv_ItemTransactionManager.DeleteInv_ItemTransaction(Convert.ToInt32(linkButton.CommandArgument));
     showInv_ItemTransactionGrid();
 }
 public void ClassInitialize()
 {
     link = new LinkButton("My Link Button");
     link.Width = 120;
     TestHarness.AddControl(link);
     link.Model.Click += delegate { Log.Info("!! Click"); };
 }
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     LinkButton linkButton = new LinkButton();
     linkButton = (LinkButton)sender;
     bool result = Pos_TransactionTypeManager.DeletePos_TransactionType(Convert.ToInt32(linkButton.CommandArgument));
     showPos_TransactionTypeGrid();
 }
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     LinkButton linkButton = new LinkButton();
     linkButton = (LinkButton)sender;
     bool result = ACC_ChartOfAccountLabel3Manager.DeleteACC_ChartOfAccountLabel3(Convert.ToInt32(linkButton.CommandArgument));
     showACC_ChartOfAccountLabel3Grid();
 }
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     LinkButton linkButton = new LinkButton();
     linkButton = (LinkButton)sender;
     bool result = Pos_ProductStatusManager.DeletePos_ProductStatus(Convert.ToInt32(linkButton.CommandArgument));
     showPos_ProductStatusGrid();
 }
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     LinkButton linkButton = new LinkButton();
     linkButton = (LinkButton)sender;
     bool result = AbsendSalaryDiductionManager.DeleteAbsendSalaryDiduction(Convert.ToInt32(linkButton.CommandArgument));
     showAbsendSalaryDiductionGrid();
 }
    public void createLinks()
    {
        if (addrList != null)
        {
            string prevName = "";

            foreach (AddressClass address in addrList)
            {
                if (address.firstLetterLN != prevName)
                {
                    
                    LinkButton temp = new LinkButton();
                    string letter = address.firstLetterLN.ToString();
                    temp.ID = letter;
                    temp.Text = letter + "  ";
                    temp.Font.Underline = false;
                    temp.Click += LinkButton1_Click;
                    Panel1.Controls.Add(temp);
                    prevName = address.firstLetterLN;

                }
            }
        }
        else
        {
            Response.Redirect(Request.RawUrl); 
        }
    }
    public void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridCommandItem)
        {
            GridCommandItem commandItem = (e.Item as GridCommandItem);
            PlaceHolder container = (PlaceHolder)commandItem.FindControl("PlaceHolder1");
            Label label = new Label();
            label.Text = "&nbsp;&nbsp;";

            container.Controls.Add(label);

            for (int i = 65; i <= 65 + 25; i++)
            {
                LinkButton linkButton1 = new LinkButton();

                LiteralControl lc = new LiteralControl("&nbsp;&nbsp;");

                linkButton1.Text = "" + (char)i;

                linkButton1.CommandName = "alpha";
                linkButton1.CommandArgument = "" + (char)i;

                container.Controls.Add(linkButton1);
                container.Controls.Add(lc);
            }

            LiteralControl lcLast = new LiteralControl("&nbsp;");
            container.Controls.Add(lcLast);

            LinkButton linkButtonAll = new LinkButton();
            linkButtonAll.Text = "Tất cả";
            linkButtonAll.CommandName = "NoFilter";
            container.Controls.Add(linkButtonAll);
        }
    }
    protected void setTable()
    {
        DataTable myDataTable = new DataTable();
        JobsModule myJobsModule = new JobsModule();
        myJobsModule.setUserId((String)Session["userId"]);

        myDataTable = myJobsModule.getEmployersJobPositions().Copy();

        myDataTable.Columns.Add("Delete", typeof(String)).SetOrdinal(0);
        myDataTable.Columns.Add("List of Applied Applicants", typeof(String)).SetOrdinal(4);

        JobPositionsGridView.DataSource = myDataTable;
        JobPositionsGridView.DataBind();

        foreach (GridViewRow row in JobPositionsGridView.Rows)
        {
            LinkButton lb = new LinkButton();
            lb.Text = "Delete";
            lb.Click += new EventHandler(LinkButtonClicked);
            row.Cells[0].Controls.Add(lb);

            HyperLink hp = new HyperLink();
            hp.Text = row.Cells[2].Text;
            hp.NavigateUrl = "~/ShowJobPositionsManager.aspx?pId=" + row.Cells[1].Text;
            row.Cells[2].Controls.Add(hp);

            HyperLink hp2 = new HyperLink();
            hp2.Text = "Show Applied Applicants";
            hp2.NavigateUrl = "~/ListOfAppliedApplicants.aspx?pId=" + row.Cells[1].Text;
            row.Cells[4].Controls.Add(hp2);
        }
    }
Exemple #12
0
    protected void BindData(LinkButton button)
    {
        GridViewRow gvr = (GridViewRow)button.Parent.Parent;
        int selectID = Convert.ToInt32(BulletinGridView.DataKeys[gvr.RowIndex].Value);
        this.EditID.Text = selectID.ToString();
        ERS.BulletinRow bulletin = ms.GetBulletinById(selectID)[0];

        string name = button.ID;
        this.EditBulletinTitleTextBox.Text = bulletin.BulletinTitle;
        this.EditBulletinContentTextBox.Text = bulletin.BulletinContent;
        this.EditIsActiveCheckBox.Checked = bulletin.IsActive;
        this.EditIsHotCheckBox.Checked = bulletin.IsHot;
        if (!bulletin.IsAttachFileNameNull())
            this.EditUCFileUpload.AttachmentFileName = bulletin.AttachFileName;
        else
            this.EditUCFileUpload.AttachmentFileName = null;
        if (!bulletin.IsRealAttachFileNameNull())
            this.EditUCFileUpload.RealAttachmentFileName = bulletin.RealAttachFileName;
        else
            this.EditUCFileUpload.RealAttachmentFileName = null;

        if (name == "TitleCtl") {
            EditBulletinTitleTextBox.ReadOnly = true;
            EditBulletinContentTextBox.ReadOnly = true;
            EditIsHotCheckBox.Enabled = false;
            EditIsActiveCheckBox.Enabled = false;
            tr1.Visible = false;
            this.EditUCFileUpload.IsView = true;
        }
        if (name == "EditBtn") {
            show();
        }
        this.Opdiv.Visible = true;
    }
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     LinkButton linkButton = new LinkButton();
     linkButton = (LinkButton)sender;
     bool result = Pos_BranchWiseProductStockCapacityManager.DeletePos_BranchWiseProductStockCapacity(Convert.ToInt32(linkButton.CommandArgument));
     showPos_BranchWiseProductStockCapacityGrid();
 }
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     LinkButton linkButton = new LinkButton();
     linkButton = (LinkButton)sender;
     bool result = Inv_QuantityUnitManager.DeleteInv_QuantityUnit(Convert.ToInt32(linkButton.CommandArgument));
     showInv_QuantityUnitGrid();
 }
Exemple #15
0
    private void DisableControls(Control gv)
    {
        LinkButton lb = new LinkButton();
        Literal l = new Literal();
        string name = String.Empty;

        for (int i = 0; i < gv.Controls.Count; i++)
        {
            if (gv.Controls[i].GetType() == typeof(LinkButton))
            {
                l.Text = (gv.Controls[i] as LinkButton).Text;
                gv.Controls.Remove(gv.Controls[i]);
                gv.Controls.AddAt(i, l);
            }
            else if (gv.Controls[i].GetType() == typeof(DropDownList))
            {
                l.Text = (gv.Controls[i] as DropDownList).SelectedItem.Text;
                gv.Controls.Remove(gv.Controls[i]);
                gv.Controls.AddAt(i, l);
            }

            if (gv.Controls[i].HasControls())
            {
                DisableControls(gv.Controls[i]);
            }
        }
    }
Exemple #16
0
    void CreateButtons()
    {
        SqlConnection con = new SqlConnection(@"Data Source=.\sqlexpress;Initial Catalog=scrapbook;Integrated Security=True");
             SqlCommand cmd1 = new SqlCommand("select * from scrapbook where recieverid='" + Session["userid"].ToString() + "'", con);
              SqlDataAdapter da1 = new SqlDataAdapter();
              da1.SelectCommand = cmd1;
              DataSet ds1 = new DataSet();
              da1.Fill(ds1, "scrapbook");
              for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
              {
                  LinkButton btn = new LinkButton();
                  SqlDataAdapter da2 = new SqlDataAdapter("select * from login where userid='" + ds1.Tables[0].Rows[i]["senderid"].ToString() + "'", con);
                  DataSet ds2 = new DataSet();
                  da2.Fill(ds2);
                 // name = ds2.Tables[0].Rows[0]["username"].ToString();
                  btn.Text =ds2.Tables[0].Rows[0]["username"].ToString();
                  btn.ID = ds2.Tables[0].Rows[0]["userid"].ToString();
                  btn.CssClass = "username";
                  usr.Controls.Add(btn);

                 // dynamiclink.Visible = true;
                  btn.Click += new EventHandler(btn_Click);
              }

           // }
    }
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     LinkButton linkButton = new LinkButton();
     linkButton = (LinkButton)sender;
     bool result = Inv_UtilizationDetailsManager.DeleteInv_UtilizationDetails(Convert.ToInt32(linkButton.CommandArgument));
     showInv_UtilizationDetailsGrid();
 }
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     LinkButton linkButton = new LinkButton();
     linkButton = (LinkButton)sender;
     bool result = MenuRoleManager.DeleteMenuRole(Convert.ToInt32(linkButton.CommandArgument));
     showMenuRoleGrid();
 }
Exemple #19
0
	private void CreateTableAlertCondition()
	{
		IList alertConditions = TheAdminServer.GameServerMonitor.AlertConditions;

		for (int i = 0; i < alertConditions.Count; i++)
		{
			AlertCondition condition = alertConditions[i] as AlertCondition;
			
			TableRow row = new TableRow();
			TableCell cell = new TableCell();
			LinkButton linkButtonRemove = new LinkButton();
            linkButtonRemove.Attributes.Add(WebConfig.ParamIndex, i.ToString());
			linkButtonRemove.SkinID = "PlainText";
			//linkButtonRemove.NavigateUrl = "AlertConfig.aspx?" + WebConfig.ParamOperation + "=" + OperationRemoveAlertCondition + "&" + WebConfig.ParamIndex + "=" + i;
            linkButtonRemove.Click += LinkButtonRemove_Click;
			linkButtonRemove.Text = StringDef.Remove;
            linkButtonRemove.ID = "LinkButtonRemove"+i.ToString();
			cell.Controls.Add(linkButtonRemove);
			row.Cells.Add(cell);
			cell = new TableCell();
			cell.Text = (i + 1).ToString();
			row.Cells.Add(cell);
			cell = new TableCell();
			cell.Text = condition.ToString();
			row.Cells.Add(cell);

			TableAlertCondition.Rows.Add(row);
		}
	}
Exemple #20
0
    public void DrawPages()
    {
        PagesRow.Controls.Clear();

        int start = 0;
        if (Pages <= 1)
            return;

        while (start < Pages)
        {
            TableCell cell = new TableCell();
            LinkButton link = new LinkButton();
            link.ID = "Link" + start.ToString();
            link.Text = (start + 1).ToString();
            link.Click += new EventHandler(link_Click);

            if (start == CurrentPage)
            {
                link.BorderStyle = BorderStyle.Solid;
                link.BorderColor = Color.Red;
                link.BorderWidth = Unit.Pixel(1);
            }
            cell.Controls.Add(link);

            PagesRow.Controls.Add(cell);
            start++;
        }
    }
 protected void lbSelect_Click(object sender, EventArgs e)
 {
     LinkButton linkButton = new LinkButton();
     linkButton = (LinkButton)sender;
     int id;
     id = Convert.ToInt32(linkButton.CommandArgument);
     Response.Redirect("AdminInv_QuantityUnitInsertUpdate.aspx?inv_QuantityUnitID=" + id);
 }
 protected void lbSelect_Click(object sender, EventArgs e)
 {
     LinkButton linkButton = new LinkButton();
     linkButton = (LinkButton)sender;
     int id;
     id = Convert.ToInt32(linkButton.CommandArgument);
     Response.Redirect("AdminEmployeeScheduleInsertUpdate.aspx?employeeScheduleID=" + id);
 }
 public ScrollDataGrid(Label lblcol, LinkButton lkbtncol, string colnameval, int colnoval, ListItemType itype)
 {
     lbl = lblcol;
     lkbtn = lkbtncol;
     colname = colnameval;
     colno = colnoval;
     itemtype = itype;
 }
 protected void lbSelect_Click(object sender, EventArgs e)
 {
     LinkButton linkButton = new LinkButton();
     linkButton = (LinkButton)sender;
     int id;
     id = Convert.ToInt32(linkButton.CommandArgument);
     Response.Redirect("AdminPos_TransactionTypeInsertUpdate.aspx?pos_TransactionTypeID=" + id);
 }
Exemple #25
0
 protected void lbSelect_Click(object sender, EventArgs e)
 {
     LinkButton linkButton = new LinkButton();
     linkButton = (LinkButton)sender;
     int id;
     id = Convert.ToInt32(linkButton.CommandArgument);
     Response.Redirect("LoginCreateAfterLogin.aspx?loginID=" + id);
 }
 protected void lbSelect_Click(object sender, EventArgs e)
 {
     LinkButton linkButton = new LinkButton();
     linkButton = (LinkButton)sender;
     int id;
     id = Convert.ToInt32(linkButton.CommandArgument);
     Response.Redirect("AdminPos_BranchWiseProductStockCapacityInsertUpdate.aspx?pos_BranchWiseProductStockCapacityID=" + id);
 }
 protected void lbSelect_Click(object sender, EventArgs e)
 {
     LinkButton linkButton = new LinkButton();
     linkButton = (LinkButton)sender;
     int id;
     id = Convert.ToInt32(linkButton.CommandArgument);
     Response.Redirect("AdminACC_ChartOfAccountLabel3InsertUpdate.aspx?aCC_ChartOfAccountLabel3ID=" + id);
 }
 protected void lbSelect_Click(object sender, EventArgs e)
 {
     LinkButton linkButton = new LinkButton();
     linkButton = (LinkButton)sender;
     int id;
     id = Convert.ToInt32(linkButton.CommandArgument);
     Response.Redirect("AdminHR_AbsentSalaryDiduction.aspx?absendSalaryDiductionID=" + id);
 }
Exemple #29
0
 protected void ListView1_LayoutCreated(object sender, EventArgs e)
 {
     if (!hasPdf)
     {
         LinkButton btnLink = new LinkButton();
         btnLink = (LinkButton)ListView1.FindControl("btnDownloadAll");
         btnLink.Visible = false;
     }
 }
Exemple #30
0
    protected async void grdPandingDetails_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try
        {
            if (e.CommandName == "ShowPopup")
            {
                j = Convert.ToInt32(Session["UserTypeId"]);

                pnlform.Visible   = true;
                pnlform.Enabled   = false;
                lnkSubmit.Visible = false;

                LinkButton  btndetails = (LinkButton)e.CommandSource;
                GridViewRow gvrow      = (GridViewRow)btndetails.NamingContainer;
                int         rwindex    = gvrow.RowIndex;
                dt = new DataTable();
                dt = (DataTable)Session["PendingPopup"];
                if (dt.Rows.Count > 0)
                {
                    lblEntry.Text = "Applied For : " + dt.Rows[rwindex]["AppliedFor"].ToString().ToUpper();
                    ApprovalCount = 0;

                    txtRollNo.Text      = dt.Rows[rwindex]["RollNo"].ToString();
                    txtStudentName.Text = dt.Rows[rwindex]["StudentName"].ToString().ToUpper();
                    ApplicatioID        = Convert.ToInt64(dt.Rows[rwindex]["ApplicationID"].ToString());
                    lblappno.Text       = Convert.ToString(ApplicatioID);
                    lngapplicationId    = Convert.ToInt32(dt.Rows[rwindex]["ApplicationID"].ToString());
                    DocTypeID           = Convert.ToInt32(dt.Rows[rwindex]["DocTypeID"].ToString());

                    //txtExamSession.Text = dt.Rows[rwindex]["ExamSession"].ToString();
                    if ((dt.Rows[rwindex]["ExamSession"].ToString() == "SUMMER") || (dt.Rows[rwindex]["ExamSession"].ToString() == "2"))
                    {
                        txtExamSession.Text = "SUMMER";
                    }
                    else if ((dt.Rows[rwindex]["ExamSession"].ToString() == "WINTER") || (dt.Rows[rwindex]["ExamSession"].ToString() == "1"))
                    {
                        txtExamSession.Text = "WINTER";
                    }

                    txtExamYear.Text   = dt.Rows[rwindex]["ExamYear"].ToString().ToUpper();
                    HideFoil.ImageUrl  = dt.Rows[rwindex]["PartAImagePath"].ToString().ToUpper();
                    HideCF.ImageUrl    = dt.Rows[rwindex]["PartBImagePath"].ToString().ToUpper();
                    ImageFoil.ImageUrl = dt.Rows[rwindex]["PartAImagePath"].ToString().ToUpper();
                    ImageCF.ImageUrl   = dt.Rows[rwindex]["PartBImagePath"].ToString().ToUpper();
                    txtBranchName.Text = dt.Rows[rwindex]["ExamBranch"].ToString().ToUpper();
                    ImageCF.Width      = 400;

                    objPlSecondLevel.Ind      = 11;
                    objPlSecondLevel.Rollno   = dt.Rows[rwindex]["RollNo"].ToString();
                    objPlSecondLevel.ExamYear = dt.Rows[rwindex]["ExamYear"].ToString();
                    objPlSecondLevel.OccCtrl  = 0;

                    if (dt.Rows[rwindex]["ExamSession"].ToString() == "SUMMER")
                    {
                        objPlSecondLevel.ExamSession = "2";
                    }
                    else if (dt.Rows[rwindex]["ExamSession"].ToString() == "WINTER")
                    {
                        objPlSecondLevel.ExamSession = "1";
                    }

                    Convert.ToInt32(objPlSecondLevel.Rollno);
                    Convert.ToInt32(objPlSecondLevel.ExamYear);
                    Convert.ToInt32(objPlSecondLevel.ExamSession);

                    txtExamName.Text = dt.Rows[0]["ExamName"].ToString().Trim().ToUpper();

                    txtExamName.Enabled                = true; txtExamSession.Enabled = false; txtExamYear.Enabled = false; txtRollNo.Enabled = false;
                    trDivision.Visible                 = trCgpa.Visible = trEnroll.Visible = trCollege.Visible =
                        trSubjectName.Visible          = trDistinctionSub.Visible = trMeritNo.Visible =
                            trLaterReferenceNo.Visible = trLaterReferenceDate.Visible = trPassingYear.Visible = trExamMedium.Visible =
                                trAwardedBy.Visible    = TrawardPrice.Visible = trResulDeclarationDate.Visible = trRank.Visible = false;

                    if (DocTypeID == 1)
                    {
                        trDivision.Visible = true;
                        trCgpa.Visible     = true;
                        txtDivision.Text   = dt.Rows[rwindex]["Division"].ToString().ToUpper();
                        txtCGPA.Text       = dt.Rows[rwindex]["CGPAPercentage"].ToString().ToUpper();
                    }
                    else if (DocTypeID == 2)
                    {
                        trEnroll.Visible   = true;
                        trDivision.Visible = true;
                        trCgpa.Visible     = true;
                        trCollege.Visible  = true;

                        txtDivision.Text      = dt.Rows[rwindex]["Division"].ToString().ToUpper();
                        txtEnrollmentlNo.Text = dt.Rows[rwindex]["EnrollmentNo"].ToString().ToUpper();
                        txtCollege.Text       = dt.Rows[rwindex]["College"].ToString().ToUpper();
                        txtCGPA.Text          = dt.Rows[rwindex]["CGPAPercentage"].ToString();
                    }
                    else if (DocTypeID == 3)
                    {
                        trEnroll.Visible         = true;
                        trSubjectName.Visible    = true;
                        trDistinctionSub.Visible = true;

                        txtEnrollmentlNo.Text  = dt.Rows[rwindex]["EnrollmentNo"].ToString().ToUpper();
                        txtSubjectName.Text    = dt.Rows[rwindex]["SubjectName"].ToString().ToUpper();
                        txtDistinctionSub.Text = dt.Rows[rwindex]["DistinctionSubject"].ToString().ToUpper();
                    }
                    else if (DocTypeID == 4)
                    {
                        trMeritNo.Visible = true;
                        txtMeritNo.Text   = dt.Rows[rwindex]["MeritNo"].ToString().ToUpper();
                    }
                    else if (DocTypeID == 6)
                    {
                        trDivision.Visible = true;
                        trMeritNo.Visible  = trRank.Visible = trAwardedBy.Visible = TrawardPrice.Visible = true;
                        txtAwardPrize.Text = dt.Rows[rwindex]["AwardPrize"].ToString();
                        if (dt.Rows[rwindex]["Ranking"] == "IInd")
                        {
                            ddlRank.SelectedIndex = 2;
                        }
                        else
                        {
                            ddlRank.SelectedIndex = 1;
                        }

                        if (dt.Rows[rwindex]["AwardedBy"].ToString() == "Gold Medal")
                        {
                            ddlAwardedby.SelectedIndex = 1;
                        }
                        else if (dt.Rows[rwindex]["AwardedBy"].ToString() == "Silver Medal")
                        {
                            ddlAwardedby.SelectedIndex = 2;
                        }
                        else if (dt.Rows[rwindex]["AwardedBy"].ToString() == "Cash Prize")
                        {
                            ddlAwardedby.SelectedIndex = 3;
                        }

                        txtDivision.Text = dt.Rows[rwindex]["Division"].ToString().ToUpper();
                        txtMeritNo.Text  = dt.Rows[rwindex]["MeritNo"].ToString().ToUpper();
                    }
                    else if (DocTypeID == 8)
                    {
                        trDivision.Visible           = true;
                        trLaterReferenceNo.Visible   = true;
                        trLaterReferenceDate.Visible = true;

                        txtDivision.Text           = dt.Rows[rwindex]["Division"].ToString().ToUpper();
                        txtLaterReferenceNo.Text   = dt.Rows[rwindex]["LetterRefNo"].ToString().ToUpper();
                        txtLaterReferenceDate.Text = Convert.ToDateTime(dt.Rows[rwindex]["LetterRefDate"]).ToString("yyyy-MM-dd");
                    }
                    else if (DocTypeID == 9)
                    {
                        trDivision.Visible = trLaterReferenceNo.Visible =
                            trLaterReferenceDate.Visible = trPassingYear.Visible = true;
                        txtDivision.Text           = dt.Rows[rwindex]["Division"].ToString().ToUpper();
                        txtPassingYear.Text        = dt.Rows[rwindex]["ExamPassingYear"].ToString().ToUpper();
                        txtLaterReferenceNo.Text   = dt.Rows[rwindex]["LetterRefNo"].ToString().ToUpper();
                        txtLaterReferenceDate.Text = Convert.ToDateTime(dt.Rows[rwindex]["LetterRefDate"]).ToString("yyyy-MM-dd");
                    }
                    else if (DocTypeID == 11)
                    {
                        trExamMedium.Visible = true;
                        txtExamMedium.Text   = dt.Rows[rwindex]["ExamMedium"].ToString().ToUpper();
                    }
                    viewApplicationModal.Style.Add("display", "block");
                    //Popup(true);
                }
            }


            HttpClient hclient = new HttpClient();
            hclient.BaseAddress = new Uri(DataAcces.Url);
            hclient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            objPlSecondLevel = new PL_SecondLevel();
            var       uri               = string.Format("api/SecondLevel/GetLevelRemark/?Ind={0}&ApplicationId={1}", 5, lngapplicationId);
            DataTable dtlevel           = null;
            var       response          = hclient.GetAsync(uri).Result;
            var       productJsonString = await response.Content.ReadAsStringAsync();

            dtlevel = JsonConvert.DeserializeObject <DataTable>(productJsonString);


            StringBuilder sb = new StringBuilder();

            if (dtlevel.Rows.Count > 0)
            {
                sb.Append("<table style='width:100%; border:1px solid;'>");
                sb.Append("<tr style='background-color:#50618c; color:white; border:1px solid;'> <th style='width:15%;'>Approval By </th><th style='width:15%;'> Approval Date </th> <th style='width:25%;'> Remark</th></tr>");
                for (int i = 0; i < dtlevel.Rows.Count; i++)
                {
                    sb.Append("<tr>");
                    sb.Append("<td style='display:none;'>" + dtlevel.Rows[i]["LevelID"] + "</td>");
                    sb.Append("<td style='border:1px solid; width:15%;'> " + dtlevel.Rows[i]["LevelDesc"] + "</td>");
                    sb.Append("<td style='border:1px solid; text-align:center; width:15%;'>" + dtlevel.Rows[i]["ApprovalDate"] + " </td>");
                    sb.Append("<td style='border:1px solid; width:25%;'>" + dtlevel.Rows[i]["LevelRemark"] + " </td>");
                    sb.Append("</tr>");
                }
                sb.Append("</table>");
                tblRemark.InnerHtml = sb.ToString();
            }
            // dtlevel = null;
        }
        catch
        { }
    }
    protected void dgInwardMaster_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try
        {
            ViewState["Index"] = Convert.ToInt32(e.CommandArgument.ToString());
            GridViewRow row = dgInwardMaster.Rows[Convert.ToInt32(ViewState["Index"].ToString())];


            if (e.CommandName == "Delete")
            {
                int rowindex = row.RowIndex;
                dgInwardMaster.DeleteRow(rowindex);
                ((DataTable)ViewState["dt2"]).Rows.RemoveAt(rowindex);
                dgInwardMaster.DataSource = ((DataTable)ViewState["dt2"]);
                dgInwardMaster.DataBind();
                if (dgInwardMaster.Rows.Count == 0)
                {
                    BlankGrid();
                }
                // clearDetail();
                calcAmt();
            }
            if (e.CommandName == "Select")
            {
                if (((Label)(row.FindControl("lblRCPD_REF_CODE"))).Text == "-2147483647")
                {
                    ddlInvoiceNo.Items.Clear();
                    txtRemaningamt.Text    = "";
                    txtRecievedAmount.Text = "";
                    txtAdjsAmt.Text        = "";
                    DataTable dtItem = new DataTable();
                    dtItem = CommonClasses.Execute("select * from NEWREFERENCE_MASTER where ES_DELETE=0   and REF_CM_COMP_ID='" + (string)Session["CompanyID"] + "'");
                    ddlInvoiceNo.DataSource     = dtItem;
                    ddlInvoiceNo.DataTextField  = "REF_NAME";
                    ddlInvoiceNo.DataValueField = "REF_CODE";
                    ddlInvoiceNo.DataBind();
                    ddlInvoiceNo.Items.Insert(0, new ListItem("Please Select Reference ", "0"));
                }
                else
                {
                    FillInvoiceNo();
                }


                LinkButton lnkDelete = (LinkButton)(row.FindControl("lnkDelete"));
                lnkDelete.Enabled = false;

                //dgInwardMaster.Columns[1].Visible = false;

                ViewState["str"]             = "Modify";
                ViewState["ItemUpdateIndex"] = e.CommandArgument.ToString();
                //LoadICode();
                //LoadIName();
                string s = ((Label)(row.FindControl("lblRCPD_INVOICE_CODE"))).Text;
                ddlRefernce.SelectedValue  = ((Label)(row.FindControl("lblRCPD_REF_CODE"))).Text;
                ddlInvoiceNo.SelectedValue = ((Label)(row.FindControl("lblRCPD_INVOICE_CODE_TEMP"))).Text;
                ddlRefernce_SelectedIndexChanged(null, null);

                txtAdjsAmt.Text = ((Label)(row.FindControl("lblRCPD_ADJ_AMOUNT"))).Text;
                if (txtAdjsAmt.Text == "")
                {
                    txtAdjsAmt.Text = "0";
                }

                //txtRate.Text = ((Label)(row.FindControl("lblSPOD_RATE"))).Text;
                txtRecievedAmount.Text = ((Label)(row.FindControl("lblRCPD_AMOUNT"))).Text;
                txtRemark.Text         = ((Label)(row.FindControl("lblRCPD_REMARK"))).Text;
                txtRemaningamt.Text    = (Convert.ToDouble(((Label)(row.FindControl("lblRCPD_AMOUNT"))).Text) + Convert.ToDouble(txtAdjsAmt.Text)).ToString();
            }
        }
        catch (Exception Ex)
        {
            CommonClasses.SendError("Reciept Entry", "dgInwardMaster_RowCommand", Ex.Message);
        }
    }
        protected void gdPagos_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                foreach (DataControlFieldCell cell in e.Row.Cells)
                {
                    foreach (Control control in cell.Controls)
                    {
                        LinkButton lnkBtnDelete = control as LinkButton;
                        if (lnkBtnDelete != null && lnkBtnDelete.CommandName == "Delete")
                        {
                            lnkBtnDelete.Attributes.Add("onclick", "javascript:return confirm('Esta seguro de eliminar este pago?');");
                        }
                    }
                }

                string sCodCentroDist = e.Row.Cells[3].Text.ToString();
                string sTipoDocumento = e.Row.Cells[4].Text.ToString();
                string sEstado        = e.Row.Cells[6].Text.ToString();

                DBConn oConn = new DBConn();
                if (oConn.Open())
                {
                    cAntCentrosDistribucion oCentrosDistribucion = new cAntCentrosDistribucion(ref oConn);
                    oCentrosDistribucion.CodCentroDist = sCodCentroDist;
                    DataTable dt = oCentrosDistribucion.GetByCod();
                    if (dt != null)
                    {
                        if (dt.Rows.Count > 0)
                        {
                            e.Row.Cells[3].Text = dt.Rows[0]["descripcion"].ToString();
                        }
                    }
                    dt = null;
                }
                oConn.Close();

                switch (sTipoDocumento)
                {
                case "1":
                    e.Row.Cells[4].Text = "CHEQUE AL DIA";
                    break;

                case "2":
                    e.Row.Cells[4].Text = "CHEQUE A FECHA";
                    break;

                case "3":
                    e.Row.Cells[4].Text = "EFECTIVO";
                    break;

                case "4":
                    e.Row.Cells[4].Text = "LETRA";
                    break;

                case "5":
                    e.Row.Cells[4].Text = "TARJETA";
                    break;

                case "6":
                    e.Row.Cells[4].Text = "TRANSFERENCIA";
                    break;
                }

                if (sEstado == "A")
                {
                    e.Row.Cells[6].Text = "ABIERTO";
                }
                else
                {
                    e.Row.Cells[6].Text = "CERRADO";
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if ((Session["LoggedInUserName"] != null))
                {
                    LinkButton LinkButton1 = (LinkButton)Master.FindControl("LinkButton1");
                    LinkButton1.Visible = false;
                    LinkButton LinkButton2 = (LinkButton)Master.FindControl("LinkButton2");
                    LinkButton2.Visible = true;


                    Label Welcome_label = (Label)Master.FindControl("Welcome_label");
                    Welcome_label.Text    = "Welcome " + Session["LoggedInUserName"];
                    Welcome_label.Visible = true;

                    LinkButton LinkButton3 = (LinkButton)Master.FindControl("LinkButton3");
                    LinkButton3.Visible = true;
                }
                else
                {
                    LinkButton LinkButton1 = (LinkButton)Master.FindControl("LinkButton1");
                    LinkButton1.Visible = true;
                    LinkButton LinkButton2 = (LinkButton)Master.FindControl("LinkButton2");
                    LinkButton2.Visible = false;
                    LinkButton LinkButton3 = (LinkButton)Master.FindControl("LinkButton3");
                    LinkButton3.Visible = false;
                }
                string RestaurantId = Request.QueryString["RestaurantId"];

                // string RestaurantId = "2";

                try
                {
                    resConn.SqlConnectionObj.Open();
                    string query2 = String.Format("Select RestaurantId, RestaurantName, RestaurantAddress, RestaurantPhone, RestaurantMinOrder, CONVERT (VARCHAR(8), OpeningHour, 108) AS OpeningHour, CONVERT (VARCHAR(8), ClosingHour, 108) AS ClosingHour,DeliveryFee from Restaurant_tbl where RestaurantId={0}", RestaurantId);
                    resConn.SqlCommandObj.CommandText = query2;
                    SqlDataReader reader = resConn.SqlCommandObj.ExecuteReader();
                    while (reader.Read())
                    {
                        Label5.Text  = reader.GetString(1).ToString();
                        Label7.Text  = reader.GetString(2).ToString();
                        Label10.Text = reader.GetString(3).ToString();

                        Label12.Text = reader.GetString(4).ToString() + "TK.";
                        Label14.Text = reader.GetInt32(7).ToString();
                        Label23.Text = " TK.";

                        Label18.Text = reader.GetString(5).ToString();
                        Label19.Text = reader.GetString(6).ToString();
                    }

                    resConn.SqlConnectionObj.Close();

                    Image2.ImageUrl = "~/HandlerImg.ashx?restId=" + RestaurantId;


                    //cheking if rest is closed
                    CheckStatus aCheck = new CheckStatus();

                    bool UserValid = aCheck.CheckUser(Request.QueryString["RestaurantId"]);

                    if (UserValid)
                    {
                        Label20.Text = "Restaurant is Open";
                    }

                    else
                    {
                        /*ei khane ei label ta thakbe plus restaurant j close tao ekta alert dia dekhabe, page e ashar shathe shathe*/
                        Label20.Text = "Restaurant Already Closed!!!";
                    }
                }
                catch (Exception ex)
                {
                    throw new Exception("Error occurred during user save operation. Try again", ex);
                }
                finally
                {
                    if (resConn.SqlConnectionObj != null && resConn.SqlConnectionObj.State == ConnectionState.Open)
                    {
                        resConn.SqlConnectionObj.Close();
                    }
                }



                GetReviews();
            }
        }
        private void CreateControls(bool setSelection)
        {
            // Load all the attribute controls
            attributeControls.Clear();
            pnlAttributes.Controls.Clear();
            phDuplicates.Controls.Clear();

            var rockContext      = new RockContext();
            var attributeService = new AttributeService(rockContext);
            var locationService  = new LocationService(rockContext);

            foreach (string categoryGuid in GetAttributeValue("AttributeCategories").SplitDelimitedValues(false))
            {
                Guid guid = Guid.Empty;
                if (Guid.TryParse(categoryGuid, out guid))
                {
                    var category = CategoryCache.Read(guid);
                    if (category != null)
                    {
                        var attributeControl = new NewGroupAttributes();
                        attributeControl.ClearRows();
                        pnlAttributes.Controls.Add(attributeControl);
                        attributeControls.Add(attributeControl);
                        attributeControl.ID         = "groupAttributes_" + category.Id.ToString();
                        attributeControl.CategoryId = category.Id;

                        foreach (var attribute in attributeService.GetByCategoryId(category.Id))
                        {
                            if (attribute.IsAuthorized(Authorization.EDIT, CurrentPerson))
                            {
                                attributeControl.AttributeList.Add(AttributeCache.Read(attribute));
                            }
                        }
                    }
                }
            }

            nfmMembers.ClearRows();
            nfciContactInfo.ClearRows();

            var groupMemberService = new GroupMemberService(rockContext);
            int defaultRoleId      = _groupType.DefaultGroupRoleId ?? _groupType.Roles.Select(r => r.Id).FirstOrDefault();

            var location = new Location();

            acAddress.GetValues(location);

            foreach (var groupMember in GroupMembers)
            {
                string groupMemberGuidString = groupMember.Person.Guid.ToString().Replace("-", "_");

                var groupMemberRow = new NewGroupMembersRow();
                groupMemberRow.GroupTypeId = _groupType.Id;
                nfmMembers.Controls.Add(groupMemberRow);
                groupMemberRow.ID              = string.Format("row_{0}", groupMemberGuidString);
                groupMemberRow.RoleUpdated    += groupMemberRow_RoleUpdated;
                groupMemberRow.DeleteClick    += groupMemberRow_DeleteClick;
                groupMemberRow.PersonGuid      = groupMember.Person.Guid;
                groupMemberRow.RequireGender   = nfmMembers.RequireGender;
                groupMemberRow.RequireGrade    = nfmMembers.RequireGrade;
                groupMemberRow.RoleId          = groupMember.GroupRoleId;
                groupMemberRow.ShowGradeColumn = _isFamilyGroupType;
                groupMemberRow.ShowGradePicker = groupMember.GroupRoleId == _childRoleId;
                groupMemberRow.ValidationGroup = BlockValidationGroup;

                var contactInfoRow = new NewGroupContactInfoRow();
                nfciContactInfo.Controls.Add(contactInfoRow);
                contactInfoRow.ID                 = string.Format("ci_row_{0}", groupMemberGuidString);
                contactInfoRow.PersonGuid         = groupMember.Person.Guid;
                contactInfoRow.IsMessagingEnabled = _SMSEnabled;
                contactInfoRow.PersonName         = groupMember.Person.FullName;

                if (_homePhone != null)
                {
                    var homePhoneNumber = groupMember.Person.PhoneNumbers.Where(p => p.NumberTypeValueId == _homePhone.Id).FirstOrDefault();
                    if (homePhoneNumber != null)
                    {
                        contactInfoRow.HomePhoneNumber      = PhoneNumber.FormattedNumber(homePhoneNumber.CountryCode, homePhoneNumber.Number);
                        contactInfoRow.HomePhoneCountryCode = homePhoneNumber.CountryCode;
                    }
                    else
                    {
                        contactInfoRow.HomePhoneNumber      = string.Empty;
                        contactInfoRow.HomePhoneCountryCode = string.Empty;
                    }
                }

                if (_cellPhone != null)
                {
                    var cellPhoneNumber = groupMember.Person.PhoneNumbers.Where(p => p.NumberTypeValueId == _cellPhone.Id).FirstOrDefault();
                    if (cellPhoneNumber != null)
                    {
                        contactInfoRow.CellPhoneNumber      = PhoneNumber.FormattedNumber(cellPhoneNumber.CountryCode, cellPhoneNumber.Number);
                        contactInfoRow.CellPhoneCountryCode = cellPhoneNumber.CountryCode;
                    }
                    else
                    {
                        contactInfoRow.CellPhoneNumber      = string.Empty;
                        contactInfoRow.CellPhoneCountryCode = string.Empty;
                    }
                }

                contactInfoRow.Email = groupMember.Person.Email;

                if (setSelection)
                {
                    if (groupMember.Person != null)
                    {
                        groupMemberRow.TitleValueId            = groupMember.Person.TitleValueId;
                        groupMemberRow.FirstName               = groupMember.Person.FirstName;
                        groupMemberRow.LastName                = groupMember.Person.LastName;
                        groupMemberRow.SuffixValueId           = groupMember.Person.SuffixValueId;
                        groupMemberRow.Gender                  = groupMember.Person.Gender;
                        groupMemberRow.BirthDate               = groupMember.Person.BirthDate;
                        groupMemberRow.ConnectionStatusValueId = groupMember.Person.ConnectionStatusValueId;
                        groupMemberRow.GradeOffset             = groupMember.Person.GradeOffset;
                    }
                }

                foreach (var attributeControl in attributeControls)
                {
                    var attributeRow = new NewGroupAttributesRow();
                    attributeControl.Controls.Add(attributeRow);
                    attributeRow.ID            = string.Format("{0}_{1}", attributeControl.ID, groupMemberGuidString);
                    attributeRow.AttributeList = attributeControl.AttributeList;
                    attributeRow.PersonGuid    = groupMember.Person.Guid;
                    attributeRow.PersonName    = groupMember.Person.FullName;

                    if (setSelection)
                    {
                        attributeRow.SetEditValues(groupMember.Person);
                    }
                }

                if (Duplicates.ContainsKey(groupMember.Person.Guid))
                {
                    var dupRow = new HtmlGenericControl("div");
                    dupRow.AddCssClass("row");
                    dupRow.ID = string.Format("dupRow_{0}", groupMemberGuidString);
                    phDuplicates.Controls.Add(dupRow);

                    var newPersonCol = new HtmlGenericControl("div");
                    newPersonCol.AddCssClass("col-md-6");
                    newPersonCol.ID = string.Format("newPersonCol_{0}", groupMemberGuidString);
                    dupRow.Controls.Add(newPersonCol);

                    newPersonCol.Controls.Add(PersonHtmlPanel(
                                                  groupMemberGuidString,
                                                  groupMember.Person,
                                                  groupMember.GroupRole,
                                                  location,
                                                  rockContext));

                    LinkButton lbRemoveMember = new LinkButton();
                    lbRemoveMember.ID = string.Format("lbRemoveMember_{0}", groupMemberGuidString);
                    lbRemoveMember.AddCssClass("btn btn-danger btn-xs");
                    lbRemoveMember.Text   = "Remove";
                    lbRemoveMember.Click += lbRemoveMember_Click;
                    newPersonCol.Controls.Add(lbRemoveMember);

                    var dupPersonCol = new HtmlGenericControl("div");
                    dupPersonCol.AddCssClass("col-md-6");
                    dupPersonCol.ID = string.Format("dupPersonCol_{0}", groupMemberGuidString);
                    dupRow.Controls.Add(dupPersonCol);

                    var duplicateHeader = new HtmlGenericControl("h4");
                    duplicateHeader.InnerText = "Possible Duplicate Records";
                    dupPersonCol.Controls.Add(duplicateHeader);

                    foreach (var duplicate in Duplicates[groupMember.Person.Guid])
                    {
                        GroupTypeRole groupTypeRole = null;
                        Location      duplocation   = null;

                        var dupGroupMember = groupMemberService.Queryable()
                                             .Where(a => a.PersonId == duplicate.Id)
                                             .Where(a => a.Group.GroupTypeId == _groupType.Id)
                                             .Select(s => new
                        {
                            s.GroupRole,
                            GroupLocation = s.Group.GroupLocations.Where(a => a.GroupLocationTypeValue.Guid.Equals(_locationType.Guid)).Select(a => a.Location).FirstOrDefault()
                        })
                                             .FirstOrDefault();
                        if (dupGroupMember != null)
                        {
                            groupTypeRole = dupGroupMember.GroupRole;
                            duplocation   = dupGroupMember.GroupLocation;
                        }

                        dupPersonCol.Controls.Add(PersonHtmlPanel(
                                                      groupMemberGuidString,
                                                      duplicate,
                                                      groupTypeRole,
                                                      duplocation,
                                                      rockContext));
                    }
                }
            }

            ShowPage();
        }
Exemple #35
0
        /// <summary>
        /// Check User permitions
        /// Set Page Header,set attributes to link buttons.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            string Mode = string.Empty;

            if (Request.QueryString["ProjectID"] != null)
            {
                Session["PROJECT_ID"] = Convert.ToInt32(Request.QueryString["ProjectID"]);
                if (Request.QueryString["HHID"] != null)
                {
                    Session["HH_ID"] = Convert.ToInt32(Request.QueryString["HHID"]);
                }
                else
                {
                    Session["HH_ID"] = null;
                }
                Session["PROJECT_CODE"] = Request.QueryString["ProjectCode"].ToString();
                Mode = Request.QueryString["Mode"].ToString();
            }
            calRequestDate.Format = UtilBO.DateFormat;

            if (!Page.ClientScript.IsClientScriptBlockRegistered(this.GetType(), "MasterJS"))
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "MasterJS",
                                                            CreateStartupScript());
            }
            if (!IsPostBack)
            {
                if (Session["PROJECT_CODE"] != null)
                {
                    Master.PageHeader = Session["PROJECT_CODE"].ToString() + " - Package Fund Request";
                }
                else
                {
                    Master.PageHeader = "Package Fund Request";
                }
                ViewState["Valuation_Status"] = "None";
                LoadSummery();
                LoadBatches();
                //GetPaymentStatus();
                getPackageReviewStatus();
                getDisclosureStatus();
                getGrievanceStatus();
                if (CheckAuthorization.HasUpdatePrivilege(UtilBO.PrivilegeCode.PRIV_PACKAGE_PAYMENT_REQ) == false)
                {
                    btnAddToBatch.Visible = false;
                    DisableAllCheckBox();
                }
                txtAmountRequested.Attributes.Add("readonly", "readonly");
                txtTotalAmount.Attributes.Add("readonly", "readonly");
                txtPaymentFor.Attributes.Add("readonly", "readonly");
            }

            if (Mode == "Readonly")
            {
                Label userNameLabel = (Label)Master.FindControl("userNameLabel");
                userNameLabel.Visible = false;
                LinkButton lnkLogout = (LinkButton)Master.FindControl("lnkLogout");
                lnkLogout.Visible = false;
                Menu NavigationMenu = (Menu)Master.FindControl("NavigationMenu");
                NavigationMenu.Visible = false;
                ImageButton imgSearch = (ImageButton)HouseholdSummary1.FindControl("imgSearch");
                imgSearch.Visible     = false;
                btnAddToBatch.Visible = false;
                DisableAllCheckBox();
            }
        }
    protected void details_Click(object sender, EventArgs e)
    {
        LinkButton lnk = sender as LinkButton;

        Response.Redirect("Details.aspx?id=" + lnk.CommandArgument + "");
    }
Exemple #37
0
        protected void gvRoyaltorRatesAudit_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                Label lblTerritory;
                Label lblCatno;
                Label lblConfigCode;
                Label lblSalesType;
                Label lblPercentageSales;
                Label lblRoyaltyRate;
                Label lblUnitRate;
                Label lblPricefield;
                Label lblUpdatedby;
                Label lblUpdatedon;
                Label lblDeletedby;
                Label lblDeletedon;

                string intRateType;
                string changeType;

                HiddenField hdnClrSeller;
                HiddenField hdnClrCatno;
                HiddenField hdnClrPrice;
                HiddenField hdnClrConfig;
                HiddenField hdnClrSalesPct;
                HiddenField hdnClrRoyRate;
                HiddenField hdnClrUnitRate;
                HiddenField hdnClrPriceField;

                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    lblTerritory       = (e.Row.FindControl("lblTerritory") as Label);
                    lblCatno           = (e.Row.FindControl("lblCatno") as Label);
                    lblConfigCode      = (e.Row.FindControl("lblConfigCode") as Label);
                    lblSalesType       = (e.Row.FindControl("lblSalesType") as Label);
                    lblPercentageSales = (e.Row.FindControl("lblPercentageSales") as Label);
                    lblRoyaltyRate     = (e.Row.FindControl("lblRoyaltyRate") as Label);
                    lblUnitRate        = (e.Row.FindControl("lblUnitRate") as Label);
                    lblPricefield      = (e.Row.FindControl("lblPricefield") as Label);
                    lblUpdatedby       = (e.Row.FindControl("lblUpdatedby") as Label);
                    lblUpdatedon       = (e.Row.FindControl("lblUpdatedon") as Label);
                    lblDeletedby       = (e.Row.FindControl("lblDeletedby") as Label);
                    lblDeletedon       = (e.Row.FindControl("lblDeletedon") as Label);

                    intRateType = (e.Row.FindControl("hdnRateType") as HiddenField).Value;
                    changeType  = (e.Row.FindControl("hdnChangeType") as HiddenField).Value;


                    hdnClrSeller     = (e.Row.FindControl("hdnClrSeller") as HiddenField);
                    hdnClrCatno      = (e.Row.FindControl("hdnClrCatno") as HiddenField);;
                    hdnClrPrice      = (e.Row.FindControl("hdnClrPrice") as HiddenField);;
                    hdnClrConfig     = (e.Row.FindControl("hdnClrConfig") as HiddenField);;
                    hdnClrSalesPct   = (e.Row.FindControl("hdnClrSalesPct") as HiddenField);;
                    hdnClrRoyRate    = (e.Row.FindControl("hdnClrRoyRate") as HiddenField);;
                    hdnClrUnitRate   = (e.Row.FindControl("hdnClrUnitRate") as HiddenField);;
                    hdnClrPriceField = (e.Row.FindControl("hdnClrPriceField") as HiddenField);;

                    lblTerritory.ForeColor       = hdnClrSeller.Value == "R" ? Color.Red : Color.Black;
                    lblCatno.ForeColor           = hdnClrCatno.Value == "R" ? Color.Red : Color.Black;
                    lblSalesType.ForeColor       = hdnClrPrice.Value == "R" ? Color.Red : Color.Black;
                    lblConfigCode.ForeColor      = hdnClrConfig.Value == "R" ? Color.Red : Color.Black;
                    lblPercentageSales.ForeColor = hdnClrSalesPct.Value == "R" ? Color.Red : Color.Black;
                    lblRoyaltyRate.ForeColor     = hdnClrRoyRate.Value == "R" ? Color.Red : Color.Black;
                    lblUnitRate.ForeColor        = hdnClrUnitRate.Value == "R" ? Color.Red : Color.Black;
                    lblPricefield.ForeColor      = hdnClrPriceField.Value == "R" ? Color.Red : Color.Black;

                    //For rate_type = 'P' display Royalty Rate
                    //For rate_type = 'U' display Unit Rate
                    //Else hide both Royalty Rate & Unit Rate
                    if (intRateType == "P")
                    {
                        lblUnitRate.Text = string.Empty;
                    }
                    else if (intRateType == "U")
                    {
                        lblRoyaltyRate.Text = string.Empty;
                    }
                    else
                    {
                        lblRoyaltyRate.Text = string.Empty;
                        lblUnitRate.Text    = string.Empty;
                    }

                    //Change the color of details to red
                    if (changeType == "D")
                    {
                        lblRoyaltyRate.ForeColor     = Color.Red;
                        lblTerritory.ForeColor       = Color.Red;
                        lblCatno.ForeColor           = Color.Red;
                        lblConfigCode.ForeColor      = Color.Red;
                        lblSalesType.ForeColor       = Color.Red;
                        lblPercentageSales.ForeColor = Color.Red;
                        lblRoyaltyRate.ForeColor     = Color.Red;
                        lblUnitRate.ForeColor        = Color.Red;
                        lblPricefield.ForeColor      = Color.Red;
                        lblUpdatedby.ForeColor       = Color.Red;
                        lblUpdatedon.ForeColor       = Color.Red;
                        lblDeletedby.ForeColor       = Color.Red;
                        lblDeletedon.ForeColor       = Color.Red;
                    }
                }

                //JIRA-746 Changes by Ravi on 05/03/2019 -- Start
                if (e.Row.RowType == DataControlRowType.Header)
                {
                    foreach (TableCell tc in e.Row.Cells)
                    {
                        if (tc.HasControls())
                        {
                            LinkButton lnkHeader = (LinkButton)tc.Controls[0];
                            lnkHeader.Style.Add("color", "black");
                            lnkHeader.Style.Add("text-decoration", "none");

                            if (lnkHeader != null && hdnSortExpression.Value == lnkHeader.CommandArgument)
                            {
                                // initialize a new image
                                System.Web.UI.WebControls.Image imgSort = new System.Web.UI.WebControls.Image();
                                imgSort.ImageUrl = (hdnSortDirection.Value == ascending) ? sort_Up : sort_Down;
                                // adding a space and the image to the header link
                                tc.Controls.Add(new LiteralControl(" "));
                                tc.Controls.Add(imgSort);
                            }
                        }
                    }
                }
                //JIRA-746 Changes by Ravi on 05/03/2019 -- End
            }
            catch (Exception ex)
            {
                ExceptionHandler("Error in binding data to grid.", ex.Message);
            }
        }
        protected void Modulpunkt_Click(object sender, EventArgs e)
        {
            LinkButton link = sender as LinkButton;

            jumpToDescription(int.Parse(link.ID.Substring(10)));
        }
        /// <summary>
        /// 列表行绑定
        /// </summary>
        protected void gvCommentList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //还原出数据
                DNNGo_DNNGalleryProGame_Files Media = e.Row.DataItem as DNNGo_DNNGalleryProGame_Files;

                if (Media != null && Media.ID > 0)
                {
                    #region "编辑&删除按钮"
                    HyperLink  hlEdit          = e.Row.FindControl("hlEdit") as HyperLink;
                    HyperLink  hlMobileEdit    = e.Row.FindControl("hlMobileEdit") as HyperLink;
                    LinkButton btnRemove       = e.Row.FindControl("btnRemove") as LinkButton;
                    LinkButton btnMobileRemove = e.Row.FindControl("btnMobileRemove") as LinkButton;
                    //设置按钮的CommandArgument
                    btnRemove.CommandArgument = btnMobileRemove.CommandArgument = Media.ID.ToString();
                    //设置删除按钮的提示
                    //if (Media.Status == (Int32)EnumFileStatus.Recycle)
                    //{
                    btnRemove.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("DeleteItem") + "');");
                    btnMobileRemove.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("DeleteItem") + "');");
                    //}
                    //else
                    //{
                    //    btnRemove.Attributes.Add("onClick", "javascript:return confirm('" + ViewResourceText("DeleteRecycleItem", "Are you sure to move it to recycle bin?") + "');");
                    //    btnMobileRemove.Attributes.Add("onClick", "javascript:return confirm('" + ViewResourceText("DeleteRecycleItem", "Are you sure to move it to recycle bin?") + "');");
                    //}

                    hlEdit.NavigateUrl = hlMobileEdit.NavigateUrl = xUrl("ID", Media.ID.ToString(), "AddMedia");
                    #endregion

                    //发布者信息
                    e.Row.Cells[3].Text = "--";
                    if (Media.LastUser > 0)
                    {
                        UserInfo uInfo = UserController.GetUserById(PortalId, Media.LastUser);
                        if (uInfo != null && uInfo.UserID > 0)
                        {
                            e.Row.Cells[3].Text = String.Format("{0}<br />{1}", uInfo.Username, uInfo.DisplayName);
                        }
                    }


                    //发布时间
                    e.Row.Cells[4].Text = Media.LastTime.ToShortDateString();

                    //状态
                    e.Row.Cells[5].Text = EnumHelper.GetEnumTextVal(Media.Status, typeof(EnumFileStatus));

                    Label lblFileExtension = e.Row.FindControl("lblFileExtension") as Label;
                    lblFileExtension.Text = Media.FileExtension;

                    Image imgFileName = e.Row.FindControl("imgFileName") as Image;

                    HyperLink hlFileName = e.Row.FindControl("hlFileName") as HyperLink;
                    hlFileName.Text        = Media.FileName.Replace("." + Media.FileExtension, "");
                    imgFileName.ImageUrl   = GetPhotoExtension(Media.FileExtension, Media.FilePath);
                    hlFileName.NavigateUrl = GetPhotoPath(Media.FilePath);

                    Label lblSize = e.Row.FindControl("lblSize") as Label;
                    lblSize.Text = Common.ConvertFileSize(Media.FileSize);
                }
            }
        }
Exemple #40
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add(_hfExpanded);
            _hfExpanded.ID       = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "filter-expanded";
            _hfExpanded.Value    = "False";

            _hfActivityTypeGuid = new HiddenField();
            Controls.Add(_hfActivityTypeGuid);
            _hfActivityTypeGuid.ID = this.ID + "_hfActivityTypeGuid";

            _lblActivityTypeName = new Label();
            Controls.Add(_lblActivityTypeName);
            _lblActivityTypeName.ClientIDMode = ClientIDMode.Static;
            _lblActivityTypeName.ID           = this.ID + "_lblActivityTypeName";

            _lblActivityTypeDescription = new Label();
            Controls.Add(_lblActivityTypeDescription);
            _lblActivityTypeDescription.ClientIDMode = ClientIDMode.Static;
            _lblActivityTypeDescription.ID           = this.ID + "_lblActivityTypeDescription";

            _lblInactive = new Label();
            Controls.Add(_lblInactive);
            _lblInactive.ClientIDMode = ClientIDMode.Static;
            _lblInactive.ID           = this.ID + "_lblInactive";
            _lblInactive.CssClass     = "pull-right";
            _lblInactive.Text         = "<span class='label label-danger'>Inactive</span>";

            _lbDeleteActivityType = new LinkButton();
            Controls.Add(_lbDeleteActivityType);
            _lbDeleteActivityType.CausesValidation = false;
            _lbDeleteActivityType.ID       = this.ID + "_lbDeleteActivityType";
            _lbDeleteActivityType.CssClass = "btn btn-xs btn-square btn-danger js-activity-delete";
            _lbDeleteActivityType.Click   += lbDeleteActivityType_Click;
            _lbDeleteActivityType.Controls.Add(new LiteralControl {
                Text = "<i class='fa fa-times'></i>"
            });

            _sbSecurity = new SecurityButton();
            Controls.Add(_sbSecurity);
            _sbSecurity.ID = this.ID + "_sbSecurity";
            _sbSecurity.Attributes["class"] = "btn btn-security btn-xs security pull-right";
            _sbSecurity.EntityTypeId        = EntityTypeCache.Get(typeof(Rock.Model.WorkflowActivityType)).Id;

            _cbActivityTypeIsActive = new RockCheckBox {
                Text = "Active"
            };
            Controls.Add(_cbActivityTypeIsActive);
            _cbActivityTypeIsActive.ID = this.ID + "_cbActivityTypeIsActive";
            string checkboxScriptFormat = @"
javascript:
    if ($(this).is(':checked')) {{
        $('#{0}').hide();
        $('#{1}').removeClass('workflow-activity-inactive');
    }}
    else {{
        $('#{0}').show();
        $('#{1}').addClass('workflow-activity-inactive');
    }}
";

            _cbActivityTypeIsActive.InputAttributes.Add("onclick", string.Format(checkboxScriptFormat, _lblInactive.ID, this.ID + "_section"));

            _tbActivityTypeName = new RockTextBox();
            Controls.Add(_tbActivityTypeName);
            _tbActivityTypeName.ID                   = this.ID + "_tbActivityTypeName";
            _tbActivityTypeName.Label                = "Name";
            _tbActivityTypeName.Required             = true;
            _tbActivityTypeName.Attributes["onblur"] = string.Format("javascript: $('#{0}').text($(this).val());", _lblActivityTypeName.ID);

            _tbActivityTypeDescription = new RockTextBox();
            Controls.Add(_tbActivityTypeDescription);
            _tbActivityTypeDescription.ID                   = this.ID + "_tbActivityTypeDescription";
            _tbActivityTypeDescription.Label                = "Description";
            _tbActivityTypeDescription.TextMode             = TextBoxMode.MultiLine;
            _tbActivityTypeDescription.Rows                 = 2;
            _tbActivityTypeDescription.Attributes["onblur"] = string.Format("javascript: $('#{0}').text($(this).val());", _lblActivityTypeDescription.ID);

            _cbActivityTypeIsActivatedWithWorkflow = new RockCheckBox {
                Text = "Activated with Workflow"
            };
            Controls.Add(_cbActivityTypeIsActivatedWithWorkflow);
            _cbActivityTypeIsActivatedWithWorkflow.ID = this.ID + "_cbActivityTypeIsActivatedWithWorkflow";
            checkboxScriptFormat = @"
javascript:
    if ($(this).is(':checked')) {{
        $('#{0}').addClass('activated-with-workflow');
    }}
    else {{
        $('#{0}').removeClass('activated-with-workflow');
    }}
";
            _cbActivityTypeIsActivatedWithWorkflow.InputAttributes.Add("onclick", string.Format(checkboxScriptFormat, this.ID + "_section"));


            _lbAddActionType = new LinkButton();
            Controls.Add(_lbAddActionType);
            _lbAddActionType.ID               = this.ID + "_lbAddAction";
            _lbAddActionType.CssClass         = "btn btn-xs btn-action add-action";
            _lbAddActionType.Click           += lbAddActionType_Click;
            _lbAddActionType.CausesValidation = false;
            _lbAddActionType.Controls.Add(new LiteralControl {
                Text = "<i class='fa fa-plus'></i> Add Action"
            });

            _pwAttributes = new PanelWidget();
            Controls.Add(_pwAttributes);
            _pwAttributes.ID       = this.ID + "_pwAttributes";
            _pwAttributes.Title    = "Activity Attributes";
            _pwAttributes.CssClass = "attribute-panel";

            _gAttributes = new Grid();
            _pwAttributes.Controls.Add(_gAttributes);
            _gAttributes.ID          = this.ID + "_gAttributes";
            _gAttributes.AllowPaging = false;
            _gAttributes.DisplayType = GridDisplayType.Light;
            _gAttributes.RowItemText = "Activity Attribute";
            _gAttributes.AddCssClass("attribute-grid");
            _gAttributes.DataKeyNames        = new string[] { "Guid" };
            _gAttributes.Actions.ShowAdd     = true;
            _gAttributes.Actions.AddClick   += gAttributes_Add;
            _gAttributes.GridRebind         += gAttributes_Rebind;
            _gAttributes.GridReorder        += gAttributes_Reorder;
            _gAttributes.ShowActionsInHeader = false;

            var reorderField = new ReorderField();

            _gAttributes.Columns.Add(reorderField);

            var nameField = new BoundField();

            nameField.DataField  = "Name";
            nameField.HeaderText = "Attribute";
            _gAttributes.Columns.Add(nameField);

            var descField = new BoundField();

            descField.DataField  = "Description";
            descField.HeaderText = "Description";
            _gAttributes.Columns.Add(descField);

            var fieldTypeField = new BoundField();

            fieldTypeField.DataField  = "FieldType";
            fieldTypeField.HeaderText = "Field Type";
            _gAttributes.Columns.Add(fieldTypeField);

            var reqField = new BoolField();

            reqField.DataField  = "IsRequired";
            reqField.HeaderText = "Required";
            _gAttributes.Columns.Add(reqField);

            var editField = new EditField();

            editField.Click += gAttributes_Edit;
            _gAttributes.Columns.Add(editField);

            var delField = new DeleteField();

            delField.Click += gAttributes_Delete;
            _gAttributes.Columns.Add(delField);
        }
    /// <summary>
    /// 附件绑定
    /// </summary>
    public void DataBindLink()
    {
        this.li1.Visible  = false;
        this.li2.Visible  = false;
        this.li3.Visible  = false;
        this.li4.Visible  = false;
        this.li5.Visible  = false;
        this.li6.Visible  = false;
        this.li7.Visible  = false;
        this.li8.Visible  = false;
        this.li9.Visible  = false;
        this.li10.Visible = false;
        this.li11.Visible = false;
        this.li12.Visible = false;

        string fid = Request.QueryString["id"];

        if (!string.IsNullOrWhiteSpace(fid))
        {
            List <Hi.Model.YZT_Annex> annexList = new Hi.BLL.YZT_Annex().GetList("", " fcID=" + fid + " and dr=0 and fileAlias='4'", "");
            foreach (Hi.Model.YZT_Annex item in annexList)
            {
                if (!string.IsNullOrEmpty(item.fileName))
                {
                    LinkButton linkFile = new LinkButton();
                    linkFile.Click += new EventHandler(Download_Click);

                    if (item.fileName.LastIndexOf("_") != -1)
                    {
                        string text = item.fileName.Substring(0, item.fileName.LastIndexOf("_")) + Path.GetExtension(item.fileName);
                        if (text.Length < 15)
                        {
                            linkFile.Text = text;
                        }
                        else
                        {
                            linkFile.Text = text.Substring(0, 15) + "...";
                        }
                        linkFile.Attributes.Add("title", text);
                    }
                    else
                    {
                        string text = item.fileName.Substring(0, item.fileName.LastIndexOf("-")) + Path.GetExtension(item.fileName);
                        if (text.Length < 15)
                        {
                            linkFile.Text = text;
                        }
                        else
                        {
                            linkFile.Text = text.Substring(0, 15) + "...";
                        }
                        linkFile.Attributes.Add("title", text);
                    }
                    linkFile.Style.Add("text-decoration", "underline");
                    linkFile.Attributes.Add("fileName", item.fileName);
                    HtmlGenericControl div = new HtmlGenericControl("div");
                    div.Controls.Add(linkFile);
                    if (item.type == 5)
                    {
                        if (!string.IsNullOrWhiteSpace(item.fileName))
                        {
                            this.li1.Visible = true;
                            UpFileText.Controls.Add(div);
                            validDate.Value = item.validDate.ToString("yyyy/MM/dd");
                        }
                    }
                    else if (item.type == 7)
                    {
                        if (!string.IsNullOrWhiteSpace(item.fileName))
                        {
                            this.li2.Visible = true;

                            UpFileText2.Controls.Add(div);
                            validDate2.Value = item.validDate.ToString("yyyy/MM/dd");
                        }
                    }
                    else if (item.type == 8)
                    {
                        if (!string.IsNullOrWhiteSpace(item.fileName))
                        {
                            this.li3.Visible = true;

                            UpFileText3.Controls.Add(div);
                            validDate3.Value = item.validDate.ToString("yyyy/MM/dd");
                        }
                    }
                    else if (item.type == 9)
                    {
                        if (!string.IsNullOrWhiteSpace(item.fileName))
                        {
                            this.li4.Visible = true;

                            UpFileText4.Controls.Add(div);
                            validDate4.Value = item.validDate.ToString("yyyy/MM/dd");
                        }
                    }
                    else if (item.type == 12)
                    {
                        if (!string.IsNullOrWhiteSpace(item.fileName))
                        {
                            this.li5.Visible = true;

                            this.HidFfileName3.Value = item.fileName;
                            this.validDate3.Value    = item.validDate.ToString("yyyy/MM/dd");
                        }
                    }
                    else if (item.type == 13)
                    {
                        if (!string.IsNullOrWhiteSpace(item.fileName))
                        {
                            this.li6.Visible = true;

                            this.HidFfileName4.Value = item.fileName;
                            this.validDate4.Value    = item.validDate.ToString("yyyy/MM/dd");
                        }
                    }
                    else if (item.type == 14)
                    {
                        if (!string.IsNullOrWhiteSpace(item.fileName))
                        {
                            this.li7.Visible = true;

                            this.HidFfileName5.Value = item.fileName;
                            this.validDate5.Value    = item.validDate.ToString("yyyy/MM/dd");
                        }
                    }
                    else if (item.type == 15)
                    {
                        if (!string.IsNullOrWhiteSpace(item.fileName))
                        {
                            this.li8.Visible = true;

                            this.HidFfileName6.Value = item.fileName;
                            this.validDate6.Value    = item.validDate.ToString("yyyy/MM/dd");
                        }
                    }
                    else if (item.type == 16)
                    {
                        if (!string.IsNullOrWhiteSpace(item.fileName))
                        {
                            this.li9.Visible = true;

                            this.HidFfileName7.Value = item.fileName;
                            this.validDate7.Value    = item.validDate.ToString("yyyy/MM/dd");
                        }
                    }
                    else if (item.type == 17)
                    {
                        if (!string.IsNullOrWhiteSpace(item.fileName))
                        {
                            this.li10.Visible = true;

                            this.HidFfileName8.Value = item.fileName;
                            this.validDate8.Value    = item.validDate.ToString("yyyy/MM/dd");
                        }
                    }
                    else if (item.type == 18)
                    {
                        if (!string.IsNullOrWhiteSpace(item.fileName))
                        {
                            this.li11.Visible = true;

                            this.HidFfileName9.Value = item.fileName;
                            this.validDate9.Value    = item.validDate.ToString("yyyy/MM/dd");
                        }
                    }
                    else if (item.type == 19)
                    {
                        if (!string.IsNullOrWhiteSpace(item.fileName))
                        {
                            this.li12.Visible = true;

                            this.HidFfileName10.Value = item.fileName;
                            this.validDate10.Value    = item.validDate.ToString("yyyy/MM/dd");
                        }
                    }
                }
            }
        }
    }
Exemple #42
0
        void dlComments_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            LinkButton btnDelete = e.Item.FindControl("btnDelete") as LinkButton;

            UIHelper.AddConfirmationDialog(btnDelete, NewsResources.NewsDeleteCommentWarning);
        }
Exemple #43
0
        protected void choose_Click(object sender, EventArgs e)
        {
            LinkButton  btn = (LinkButton)sender;
            GridViewRow row = (GridViewRow)btn.NamingContainer;

            int    index        = row.RowIndex;
            string lenda        = Grid1.DataKeys[index].Values[0].ToString();
            int    kredite      = Convert.ToInt32(Grid1.DataKeys[index].Values[1].ToString());
            string dataprovimit = Grid1.DataKeys[index].Values[2].ToString();
            string ora          = Grid1.DataKeys[index].Values[3].ToString();
            string salla        = Grid1.DataKeys[index].Values[4].ToString();

            using (SqlConnection con = new SqlConnection(cs))
            {
                string query2 = "Select Top 1 IdKursi From Kursi Where EmerK=@em";

                string query = "Select * From StudentKursiSezoni Where SsnStudent=@ssn AND IdKursi=@IdK";

                SqlCommand cmd = new SqlCommand(query2, con);
                cmd.Parameters.AddWithValue("@em", lenda);
                string     IdKurs = "";
                SqlCommand cmd2   = new SqlCommand(query, con);

                con.Open();
                reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    IdKurs = reader.GetValue(0).ToString();
                }
                reader.Close();
                cmd2.Parameters.AddWithValue("@ssn", Session["SSN"].ToString());
                cmd2.Parameters.AddWithValue("@IdK", IdKurs);
                reader = cmd2.ExecuteReader();
                if (reader.HasRows)//Kontrollon nqs ka qen i Rregjistruar me pare dhe i ndryshohen vlerat me aktualet nqs po, dhe nqs jo shtohet ne tabele
                {
                    reader.Close();
                    string     updatequery = "Update StudentKursiSezoni Set IdSezoni=@IdS,Nota=@not,DataP=@Dp,OraP=@Op,Vendndodhja=@Vp where SsnStudent=@ssn AND IdKursi=@IdK";
                    SqlCommand cmdup       = new SqlCommand(updatequery, con);
                    cmdup.Parameters.AddWithValue("@IdS", Session["Sezoni"].ToString());
                    cmdup.Parameters.AddWithValue("@not", DBNull.Value);
                    cmdup.Parameters.AddWithValue("@Dp", dataprovimit);
                    cmdup.Parameters.AddWithValue("@Op", ora);
                    cmdup.Parameters.AddWithValue("@Vp", salla);
                    cmdup.Parameters.AddWithValue("@ssn", Session["SSN"].ToString());
                    cmdup.Parameters.AddWithValue("@IdK", IdKurs);
                    cmdup.ExecuteNonQuery();
                }
                else
                {
                    reader.Close();
                    string     insertquery = "Insert Into StudentKursiSezoni(SsnStudent,IdKursi,IdSezoni,DataP,OraP,Vendndodhja) Values (@ssn,@IdK,@IdS,@Dp,@Op,@Vp)";
                    SqlCommand cmdins      = new SqlCommand(insertquery, con);
                    cmdins.Parameters.AddWithValue("@ssn", Session["SSN"].ToString());
                    cmdins.Parameters.AddWithValue("@IdK", IdKurs);
                    cmdins.Parameters.AddWithValue("@IdS", Session["Sezoni"].ToString());
                    cmdins.Parameters.AddWithValue("@Dp", dataprovimit);
                    cmdins.Parameters.AddWithValue("@Op", ora);
                    cmdins.Parameters.AddWithValue("@Vp", salla);

                    cmdins.ExecuteNonQuery();
                }
                AfishoGrid();
                LendeTeRegj();
            }
        }
Exemple #44
0
    /// 绑定数据
    /// </summary>
    ///

    public void GridViewDataBind()
    {
        string    sql   = "SELECT * FROM [userinfo] WHERE number ='" + Session["number"] + "'";
        DataTable dt    = SqlHelper.ExecuteDataTable(sql);
        int       i_all = dt.Rows.Count;

        for (int i = 0; i < i_all; i++)
        {
            TextBox1.Text = dt.Rows[i]["name"].ToString();
            TextBox2.Text = dt.Rows[i]["number"].ToString();
            TextBox3.Text = dt.Rows[i]["jibie"].ToString();
            TextBox4.Text = dt.Rows[i]["bumen"].ToString();
            TextBox6.Text = dt.Rows[i]["ruzhi"].ToString();
            string    a        = dt.Rows[i]["shangji"].ToString();
            string    sql_name = "SELECT * FROM [userinfo] WHERE number ='" + a + "'"; //解决部门和入职时间问题
            DataTable dt2      = SqlHelper.ExecuteDataTable(sql_name);
            int       i_all2   = dt2.Rows.Count;
            if (i_all2 > 0)
            {
                TextBox5.Text = dt2.Rows[0]["name"].ToString();
            }
        }
        string  sql2 = "select * from [ShenQingShenBao] where s_number='" + Session["number"] + "' order by  s_time desc";
        DataSet ds2  = SqlHelper.ExecuteDataSet(sql2);

        Session["Table"]  = ds2.Tables[0];
        gvShow.DataSource = ds2;
        gvShow.DataBind();

        foreach (GridViewRow row in gvShow.Rows)
        {
            string   gettime = row.Cells[0].Text;
            string[] s_th1 = gettime.Split('-');
            int      i = 0;
            string   year = "", month = "", sec = "";
            foreach (string _s1 in s_th1)
            {
                if (i == 0)
                {
                    year = _s1;
                }
                if (i == 1)
                {
                    month = _s1;
                }
                if (i == 2)
                {
                    sec = _s1;
                }
                i++;
            }
            System.DateTime newDate = new DateTime(int.Parse(year), int.Parse(month), int.Parse(sec));
            //    System.Diagnostics.Debug.Write("newDate=" + newDate.ToString());
            row.Cells[0].Text += " " + getweek(newDate.DayOfWeek.ToString());
            LinkButton lb  = row.Cells[2].FindControl("lbEdit") as LinkButton;
            LinkButton lt  = row.Cells[3].FindControl("lbDelete") as LinkButton;
            string     str = row.Cells[2].Text;


            if (str == "1" || str == "2" || str == "3" || str == "4")
            {
                lb.Visible = false;
                lt.Visible = false;

                row.Cells[2].Text = "已批阅";
            }
            else
            {
                lb.Visible        = true;
                lt.Visible        = true;
                row.Cells[2].Text = "未批阅";
            }
        }
    }
    protected void lstInbox_ItemDataBound(object sender, ListViewItemEventArgs e)
    {
        LinkButton  lnkinbox      = (LinkButton)e.Item.FindControl("lnkinbox");
        HiddenField hdnMaxCount   = (HiddenField)e.Item.FindControl("hdnMaxCount");
        LinkButton  lnkOutbox     = (LinkButton)e.Item.FindControl("lnkOutbox");
        HiddenField hdnAddedBy    = (HiddenField)e.Item.FindControl("hdnAddedBy");
        LinkButton  lnksubject    = (LinkButton)e.Item.FindControl("lnksubject");
        HiddenField hdnIsRead     = (HiddenField)e.Item.FindControl("hdnIsRead");
        Label       lblSenderName = (Label)e.Item.FindControl("lblSenderName");
        LinkButton  lblDate       = (LinkButton)e.Item.FindControl("lblDate");
        //HtmlTableRow lblinboxFrom = (HtmlTableRow)e.Item.FindControl("lblinboxFrom");
        //HtmlTableRow lblinboxTo = (HtmlTableRow)e.Item.FindControl("lblinboxTo");
        HtmlHead lblinboxFrom1 = (HtmlHead)e.Item.FindControl("lblinboxFrom");
        //HtmlTableCell lblinboxFrom2 = (HtmlTableCell)e.Item.FindControl("lblinboxFrom");
        Label lblinboxFrom3 = (Label)e.Item.FindControl("lblinboxFrom");
        //   HtmlTableCell thFrom = (HtmlTableCell)lstInbox.FindControl("thFrom");
        //  HtmlTableCell thTo = (HtmlTableCell)lstInbox.FindControl("thTo");
        HiddenField hdnIsReadSent          = (HiddenField)e.Item.FindControl("hdnIsReadSent");
        HiddenField hdnSubjectmsg          = (HiddenField)e.Item.FindControl("hdnSubjectmsg");
        HiddenField hdnstrTotalGrpMemberID = (HiddenField)e.Item.FindControl("hdnstrTotalGrpMemberID");
        HtmlControl ddcard = (HtmlControl)e.Item.FindControl("divCard");

        if (ViewState["IsReadSent"] != null)
        {
            if (hdnIsReadSent.Value.ToString().Trim() != "" && hdnIsReadSent.Value.ToString().Trim() != null && hdnIsReadSent.Value.ToString().Trim() != "0")
            {
                divCard.Attributes["class"] = "msg-card expand-card read-msg";
                //lnksubject.ForeColor = System.Drawing.Color.Gray;
                //lblSenderName.ForeColor = System.Drawing.Color.Gray;
                //lblDate.ForeColor = System.Drawing.Color.Gray;
            }
        }
        else
        {
            if (hdnIsRead.Value.ToString().Trim() != "" && hdnIsRead.Value.ToString().Trim() != null && hdnIsRead.Value.ToString().Trim() != "0")
            {
                divCard.Attributes["class"] = "msg-card expand-card read-msg";
                //lnksubject.ForeColor = System.Drawing.Color.Gray;
                //lblSenderName.ForeColor = System.Drawing.Color.Gray;
                //lblDate.ForeColor = System.Drawing.Color.Gray;
            }
        }

        if (string.IsNullOrEmpty(maxcount))
        {
            maxcount = "1";
        }
        if (hdnstrTotalGrpMemberID.Value != "")
        {
            lnksubject.Text = hdnstrTotalGrpMemberID.Value + " : " + hdnSubjectmsg.Value;
        }

        if (Convert.ToString(ViewState["Sent"]) == "SentClick")
        {
            //   thTo.Style.Add("display", "block");
            //   thFrom.Visible = false;
        }
        else
        {
            //  thTo.Style.Add("display", "none");
            // thFrom.Visible = true;
            lnksubject.Enabled    = true;
            lblSenderName.Enabled = true;
            lblDate.Enabled       = true;
        }
    }
Exemple #46
0
    protected void dgvGridView_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
    {
        if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
        {
            objCommon = new clsCommon();

            if (e.CommandName == "Up")
            {
                LinkButton  inkButton = (LinkButton)e.CommandSource;
                GridViewRow drCurrent = (GridViewRow)inkButton.Parent.Parent;
                if (drCurrent.RowIndex > 0)
                {
                    GridViewRow drUp = dgvGridView.Rows[drCurrent.RowIndex - 1];
                    objCommon.SetDisplayOrder("tblOrderStatus", tblOrderStatus.ColumnNames.AppOrderStatusID, tblOrderStatus.ColumnNames.AppDisplayOrder, (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[1], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[0], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[1]);
                    LoadDataGrid(false, false);
                    objCommon = null;
                }
            }
            else if (e.CommandName == "Down")
            {
                LinkButton  lnkButton = (LinkButton)e.CommandSource;
                GridViewRow drCurrent = (GridViewRow)lnkButton.Parent.Parent;
                if (drCurrent.RowIndex < dgvGridView.Rows.Count - 1)
                {
                    GridViewRow drUp = dgvGridView.Rows[drCurrent.RowIndex + 1];
                    objCommon.SetDisplayOrder("tblOrderStatus", tblOrderStatus.ColumnNames.AppOrderStatusID, tblOrderStatus.ColumnNames.AppDisplayOrder, (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[1], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[0], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[1]);
                    LoadDataGrid(false, false);
                    objCommon = null;
                }
            }
            else if (e.CommandName == "IsActive")
            {
                objOrderStatus = new tblOrderStatus();
                if (objOrderStatus.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())))
                {
                    if (!objOrderStatus.AppIsDefault)
                    {
                        if (objOrderStatus.AppIsActive == true)
                        {
                            objOrderStatus.AppIsActive = false;
                        }
                        else if (objOrderStatus.AppIsActive == false)
                        {
                            objOrderStatus.AppIsActive = true;
                        }
                        objOrderStatus.Save();

                        LoadDataGrid(false, false);
                    }
                }
                objOrderStatus = null;
            }
            else if (e.CommandName == "IsDefault")
            {
                objOrderStatus = new tblOrderStatus();
                objOrderStatus.SetDefaultOrderStatus(e.CommandArgument.ToString());
                objOrderStatus = null;
                LoadDataGrid(false, false);
            }
        }
    }
Exemple #47
0
        /// <summary>
        /// Used to populate each item in the PackageList
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void gPackageList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            IPackage package = e.Row.DataItem as IPackage;

            if (package != null)
            {
                Boolean isPackageInstalled = NuGetService.IsPackageInstalled(package, anyVersion: true);

                LinkButton lbCommand           = e.Row.FindControl("lbCommand") as LinkButton;
                LinkButton lbUpdate            = e.Row.FindControl("lbUpdate") as LinkButton;
                LinkButton lbView              = e.Row.FindControl("lbView") as LinkButton;
                HtmlAnchor link                = e.Row.FindControl("lProjectUrl") as HtmlAnchor;
                Literal    lblAuthors          = e.Row.FindControl("lblAuthors") as Literal;
                Literal    lblVersion          = e.Row.FindControl("lblVersion") as Literal;
                Literal    lblLatestVersion    = e.Row.FindControl("lblLatestVersion") as Literal;
                Literal    lblInstalledVersion = e.Row.FindControl("lblInstalledVersion") as Literal;

                if (package.IconUrl != null)
                {
                    Image imgIconUrl = e.Row.FindControl("imgIconUrl") as Image;
                    imgIconUrl.ImageUrl = package.IconUrl.ToString();;
                }

                lblAuthors.Text = string.Join(",", package.Authors);

                if (package.ProjectUrl != null)
                {
                    link.Visible = true;
                    link.HRef    = package.ProjectUrl.ToString();
                }
                else
                {
                    link.Visible = false;
                }

                lbUpdate.Visible = false;

                // If this package (not necessarily this version) is installed
                // show an uninstall button and/or an update button if a later version exists
                if (isPackageInstalled)
                {
                    IPackage theInstalledPackage = NuGetService.GetInstalledPackage(package.Id);
                    if (theInstalledPackage != null)
                    {
                        lblInstalledVersion.Visible = true;
                        lblInstalledVersion.Text   += theInstalledPackage.Version;

                        try
                        {
                            // Checking "IsLatestVersion" does not work because of what's discussed here:
                            // http://nuget.codeplex.com/discussions/279837
                            // if ( !installedPackage.IsLatestVersion )...
                            var latestPackage = NuGetService.GetUpdate(package);
                            if (latestPackage != null)
                            {
                                lbUpdate.Visible         = true;
                                lblLatestVersion.Visible = true;
                                lblLatestVersion.Text   += latestPackage.Version;
                            }
                        }
                        catch (InvalidOperationException ex)
                        {
                            Literal lblItemError = e.Row.FindControl("lblItemError") as Literal;
                            lblItemError.Text = string.Format("<p class='text-error'>We're having a problem... {0}</p>", ex.Message);
                        }
                    }

                    lbCommand.CommandName = "uninstall";
                    lbCommand.Text        = "<i class='fa fa-times'></i> &nbsp; Uninstall";
                    lbCommand.AddCssClass("btn-warning");
                }
                else
                {
                    lblVersion.Visible    = true;
                    lblVersion.Text      += package.Version;
                    lbCommand.CommandName = "Install";
                    lbCommand.Text        = "<i class='fa fa-download'></i> &nbsp; Install";
                }

                lbCommand.CommandArgument = lbUpdate.CommandArgument = lbView.CommandArgument = e.Row.RowIndex.ToString();
            }
        }
    protected void rg_advertisers_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item   = (GridDataItem)e.Item;
            String       cpy_id = item["ad_cpy_id"].Text;
            String       ctc_id = item["ad_ctc_id"].Text;

            String focus_ctc_id = String.Empty;
            if (ctc_id != "&nbsp;")
            {
                focus_ctc_id = "&ctc_id=" + ctc_id;
            }

            // View Company
            LinkButton lb = (LinkButton)item["Advertiser"].FindControl("lb_view_cpy");
            lb.OnClientClick = "parent.radopen('trackercompanycontacteditor.aspx?cpy_id=" + Server.UrlEncode(cpy_id) + focus_ctc_id + "&cpy_type=a&issue=" + Server.UrlEncode(hf_issue_name.Value) + "', 'rw_ss_editor'); return false;";
            lb.Text          = Server.HtmlEncode(Util.TruncateText(Server.HtmlDecode(lb.Text), 30));

            // Hyperlink contact name with email
            if (item["Email"].Text != "&nbsp;")
            {
                HyperLink hl_e = new HyperLink();
                hl_e.NavigateUrl = "mailto:" + item["Email"].Text;
                hl_e.Text        = item["Contact"].Text;
                item["Contact"].Controls.Clear();
                item["Contact"].Controls.Add(hl_e);
            }

            // Shared Indicators
            String[] ShareIndications = new String[] { "twitter", "facebook", "linkedin", "website", "other" };
            foreach (String i in ShareIndications)
            {
                ImageButton        imbtn_s = (ImageButton)item[i].FindControl("imbtn_so_" + i);
                HtmlGenericControl div     = (HtmlGenericControl)item[i].FindControl("div_so_" + i);
                ram_p.AjaxSettings.AddAjaxSetting(div, div); // ajaxify the div
                if (imbtn_s.CommandName == "1")
                {
                    imbtn_s.ImageUrl = "~/images/smartsocial/ico_tick.png";
                }
                else
                {
                    imbtn_s.ImageUrl = "~/images/smartsocial/ico_cross.png";
                }
            }

            // Notes tooltip
            if (item["SSNotes"].Text != "&nbsp;")
            {
                Util.AddRadToolTipToRadGridCell(item["SSNotes"], false, 0, "#dcfadc");
            }

            // External links
            String[] Links = new String[] { "LinkedIn", "Twitter", "Facebook" };
            foreach (String l in Links)
            {
                String url       = l + "URL";
                String link_name = l + "Link";
                if (item[url].Text != "&nbsp;")
                {
                    HyperLink hl = (HyperLink)item[link_name].FindControl("hl_" + l);
                    hl.Visible = true;
                    if (!item[url].Text.StartsWith("http") && !item[url].Text.StartsWith("https"))
                    {
                        item[url].Text = "http://" + item[url].Text;
                    }
                    hl.NavigateUrl = item[url].Text;
                }
            }
        }
    }
Exemple #49
0
        /// <summary>
        /// Evento disparado al presionar el LinkButton "Bitacora" o "Referencias"
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void lkbDetalles_Click(object sender, EventArgs e)
        {         //Evaluando que el GridView tenga registros
            if (gvComprobantes.DataKeys.Count > 0)
            {     //Referenciando al botón pulsado
                using (LinkButton boton = (LinkButton)sender)
                { //Seleccionando la fila actual
                    Controles.SeleccionaFila(gvComprobantes, sender, "lnk", false);
                    //Evaluando Boton Presionado
                    switch (boton.CommandName)
                    {
                    case "Bitacora":
                    {           //Visualizando bitácora de registro
                        inicializaBitacoraRegistro(gvComprobantes.SelectedValue.ToString(), "119", "Bitacora");
                        break;
                    }

                    case "Referencias":
                    {           //Visualizando referencia de registro
                        inicializaReferencias(gvComprobantes.SelectedValue.ToString(), "119", "Combrobante");
                        break;
                    }

                    case "Email":
                    {
                        //Inicializando contenido de controles de envío de correo
                        //Instanciando comprobante de interés
                        using (SAT_CL.FacturacionElectronica.Comprobante comp = new SAT_CL.FacturacionElectronica.Comprobante(Convert.ToInt32(gvComprobantes.SelectedDataKey["Id"])))
                        {
                            //Si hay comprobante timbrado
                            if (comp.generado)
                            {
                                //Instanciando compañía de interés
                                using (SAT_CL.Global.CompaniaEmisorReceptor c = new SAT_CL.Global.CompaniaEmisorReceptor(comp.id_compania_emisor))
                                {
                                    string destinatarios = "";
                                    //Cargando contactos (Destinatarios)
                                    using (DataTable mitContactos = SAT_CL.Global.Referencia.CargaReferencias(comp.id_compania_receptor, 25, 2058))
                                    {
                                        //Si hay elementos
                                        if (mitContactos != null)
                                        {
                                            foreach (DataRow r in mitContactos.Rows)
                                            {
                                                //Si ya existe contenido en el control
                                                if (destinatarios != "")
                                                {
                                                    destinatarios = destinatarios + ";\r\n" + r.Field <string>("Valor");
                                                }
                                                //De lo contrario
                                                else
                                                {
                                                    destinatarios = r.Field <string>("Valor");
                                                }
                                            }
                                        }
                                    }

                                    //Inicializando control de envío de comprobante
                                    wucEmailCFDI.InicializaControl(((SAT_CL.Seguridad.Usuario)Session["usuario"]).email, string.Format("CFDI {0} [{1}]", comp.serie + comp.folio.ToString(), c.rfc), destinatarios,
                                                                   "Los archivos se encuentran adjuntos en este mensaje. Si usted no ha solicitado el envío de este comprobante, por favor contacte a su ejecutivo de cuenta.", comp.id_comprobante);
                                }
                            }
                            else
                            {
                                ScriptServer.MuestraNotificacion(this, "El comprobante no se ha timbrado.", ScriptServer.NaturalezaNotificacion.Error, ScriptServer.PosicionNotificacion.AbajoDerecha);
                            }
                        }

                        //Abrir Ventana Modal
                        ScriptServer.AlternarVentana(this, "EnvioEmail", "contenidoConfirmacionEmail", "confirmacionEmail");

                        break;
                    }

                    case "XML":
                    {
                        //Instanciamos Comprobante
                        using (SAT_CL.FacturacionElectronica.Comprobante c = new SAT_CL.FacturacionElectronica.Comprobante(Convert.ToInt32(gvComprobantes.SelectedValue)))
                        {
                            //Si existe y está generado
                            if (c.generado)
                            {
                                //Obteniendo bytes del archivo XML
                                byte[] cfdi_xml = System.IO.File.ReadAllBytes(c.ruta_xml);

                                //Realizando descarga de archivo
                                if (cfdi_xml.Length > 0)
                                {
                                    //Instanciando al emisor
                                    using (SAT_CL.Global.CompaniaEmisorReceptor em = new SAT_CL.Global.CompaniaEmisorReceptor(c.id_compania_emisor))
                                        TSDK.Base.Archivo.DescargaArchivo(cfdi_xml, string.Format("{0}_{1}{2}.xml", em.nombre_corto != "" ? em.nombre_corto: em.rfc, c.serie, c.folio), TSDK.Base.Archivo.ContentType.binary_octetStream);
                                }
                            }
                        }
                        break;
                    }

                    case "PDF":
                    {
                        //Obteniendo Ruta
                        string urlReporte = TSDK.Base.Cadena.RutaRelativaAAbsoluta("~/FacturacionElectronica/ReporteComprobante.ascx", "~/RDLC/Reporte.aspx");
                        //Instanciamos Comprobante
                        using (SAT_CL.FacturacionElectronica.Comprobante objComprobante = new SAT_CL.FacturacionElectronica.Comprobante(Convert.ToInt32(gvComprobantes.SelectedValue)))
                        {
                            //Validamos que el comprobante se encuentre Timbrado
                            if (objComprobante.generado)
                            {
                                //Instanciando nueva ventana de navegador para apertura de registro
                                TSDK.ASP.ScriptServer.AbreNuevaVentana(string.Format("{0}?idTipoReporte={1}&idRegistro={2}", urlReporte, "Comprobante", objComprobante.id_comprobante), "Comprobante", "location=NO,toolbar=NO,scrollbars=YES,menubar=NO,status=YES,width=800,height=500", Page);
                            }
                        }

                        break;
                    }
                    }
                }
            }
        }
Exemple #50
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            Controls.Clear();

            _hfExpanded = new HiddenField();
            Controls.Add(_hfExpanded);
            _hfExpanded.ID    = this.ID + "_hfExpanded";
            _hfExpanded.Value = "False";

            _hfActivityGuid = new HiddenField();
            Controls.Add(_hfActivityGuid);
            _hfActivityGuid.ID = this.ID + "_hfActivityTypeGuid";

            _lblActivityTypeName = new Label();
            Controls.Add(_lblActivityTypeName);
            _lblActivityTypeName.ClientIDMode = ClientIDMode.Static;
            _lblActivityTypeName.ID           = this.ID + "_lblActivityTypeName";

            _lblActivityTypeDescription = new Label();
            Controls.Add(_lblActivityTypeDescription);
            _lblActivityTypeDescription.ClientIDMode = ClientIDMode.Static;
            _lblActivityTypeDescription.ID           = this.ID + "_lblActivityTypeDescription";

            _lblStatus = new Label();
            Controls.Add(_lblStatus);
            _lblStatus.ClientIDMode = ClientIDMode.Static;
            _lblStatus.ID           = this.ID + "_lblInactive";
            _lblStatus.CssClass     = "pull-right";

            _lbDeleteActivityType = new LinkButton();
            Controls.Add(_lbDeleteActivityType);
            _lbDeleteActivityType.CausesValidation = false;
            _lbDeleteActivityType.ID       = this.ID + "_lbDeleteActivityType";
            _lbDeleteActivityType.CssClass = "btn btn-xs btn-danger js-activity-delete";
            _lbDeleteActivityType.Click   += lbDeleteActivityType_Click;
            _lbDeleteActivityType.Controls.Add(new LiteralControl {
                Text = "<i class='fa fa-times'></i>"
            });

            _cbActivityIsComplete = new RockCheckBox {
                Text = "Complete"
            };
            Controls.Add(_cbActivityIsComplete);
            _cbActivityIsComplete.ID    = this.ID + "_cbActivityTypeIsActive";
            _cbActivityIsComplete.Label = "Activity Completed";
            _cbActivityIsComplete.Text  = "Yes";

            _ppAssignedToPerson    = new PersonPicker();
            _ppAssignedToPerson.ID = this.ID + "_ppAssignedToPerson";
            Controls.Add(_ppAssignedToPerson);
            _ppAssignedToPerson.Label = "Assign to Person";

            _lAssignedToPerson    = new RockLiteral();
            _lAssignedToPerson.ID = this.ID + "_lAssignedToPerson";
            Controls.Add(_lAssignedToPerson);
            _lAssignedToPerson.Label = "Assigned to Person";

            _gpAssignedToGroup    = new GroupPicker();
            _gpAssignedToGroup.ID = this.ID + "_gpAssignedToGroup";
            Controls.Add(_gpAssignedToGroup);
            _gpAssignedToGroup.Label = "Assign to Group";

            _lAssignedToGroup    = new RockLiteral();
            _lAssignedToGroup.ID = this.ID + "_lAssignedToGroup";
            Controls.Add(_lAssignedToGroup);
            _lAssignedToGroup.Label = "Assigned to Group";

            _ddlAssignedToRole = new RockDropDownList();
            Controls.Add(_ddlAssignedToRole);
            _ddlAssignedToRole.ID    = this.ID + "_ddlAssignedToRole";
            _ddlAssignedToRole.Label = "Assign to Security Role";

            _lAssignedToRole    = new RockLiteral();
            _lAssignedToRole.ID = this.ID + "_lAssignedToRole";
            Controls.Add(_lAssignedToRole);
            _lAssignedToRole.Label = "Assigned to Security Role";

            _lState = new Literal();
            Controls.Add(_lState);
            _lState.ID = this.ID + "_lState";

            _ddlAssignedToRole.Items.Add(new ListItem(string.Empty, "0"));
            var roles = new GroupService(new RockContext()).Queryable().Where(g => g.IsSecurityRole).OrderBy(t => t.Name);

            if (roles.Any())
            {
                foreach (var role in roles)
                {
                    _ddlAssignedToRole.Items.Add(new ListItem(role.Name, role.Id.ToString()));
                }
            }

            _phAttributes = new PlaceHolder();
            Controls.Add(_phAttributes);
            _phAttributes.ID = this.ID + "_phAttributes";
        }
    protected void ObjectsGrid_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        LinkButton l = (LinkButton)e.Item.FindControl("Delete_btn");
        l.Attributes.Add("onclick", "javascript:return confirm('Əminsiniz?')");

    }
    protected void lstInbox_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
        HiddenField hdnMessId = (HiddenField)e.Item.FindControl("hdnMessId");
        HiddenField hdnGrpId  = (HiddenField)e.Item.FindControl("hdnGrpId");
        HtmlControl divCard   = (HtmlControl)e.Item.FindControl("divCard");

        //  HtmlTableCell thFrom = (HtmlTableCell)lstInbox.FindControl("thFrom");
        // HtmlTableCell thTo = (HtmlTableCell)lstInbox.FindControl("thTo");
        if (e.CommandName == "GetMessageSetails")
        {
            if (ViewState["IsReadSent"] == null)
            {
                LinkButton btnReplyMess = (LinkButton)e.Item.FindControl("btnReplyMess");
                btnReplyMess.Visible     = true;
                objRecmndDO.intMessageId = Convert.ToInt32(hdnMessId.Value);//Convert.ToInt32(hdnAddedBy.Value);
                ViewState["MessageId"]   = objRecmndDO.intMessageId;
                objRecmndDA.Scrl_AddEditDelRecommendations(objRecmndDO, DA_Scrl_UserRecommendation.Scrl_UserRecommendation.UpdateIsRead);
                GetMessageNotification();
            }
            else
            {
                //   divSuccessMess.Style.Add("display", "none");
                //   dvPopup.Style.Add("display", "block");
                objRecmndDO.intMessageId = Convert.ToInt32(hdnMessId.Value);//Convert.ToInt32(hdnAddedBy.Value);
                ViewState["MessageId"]   = objRecmndDO.intMessageId;
                objRecmndDA.Scrl_AddEditDelRecommendations(objRecmndDO, DA_Scrl_UserRecommendation.Scrl_UserRecommendation.UpdateIsReadSent);
                //dt = objRecmndDA.GetDataTable(objRecmndDO, DA_Scrl_UserRecommendation.Scrl_UserRecommendation.GetSentMessageDetaisByMessId);
                //if (dt.Rows.Count > 0)
                //{
                //    ViewState["GrpId"] = hdnGrpId.Value;
                //    lblTo.Text = Convert.ToString(dt.Rows[0]["Name"]) + "  [" + Convert.ToString(dt.Rows[0]["vchrUserName"]) + "]";
                //    lblFrom.Text = Convert.ToString(dt.Rows[0]["Name"]) + "  [" + Convert.ToString(dt.Rows[0]["vchrUserName"]) + "]";
                //      lblMessesage.Text = Convert.ToString(dt.Rows[0]["StrRecommendation"]);
                //        GetTotalOutBox();
                //       GetMessageNotification();
                //           thTo.Style.Add("display", "block");
                //          thFrom.Visible = false;
                //    MessTo.Style.Add("display", "block");
                //    MessFrom.Style.Add("display", "none");
            }

            divCard.Attributes["class"] = "msg-card expand-card read-msg";
            LinkButton lnksubject = (LinkButton)e.Item.FindControl("lnksubject");
            lnksubject.CssClass = "display-block un-anchor";
            Label      lblSenderName = (Label)e.Item.FindControl("lblSenderName");
            LinkButton lblDate       = (LinkButton)e.Item.FindControl("lblDate");
            //lnksubject.ForeColor = System.Drawing.Color.Gray;
            //lblSenderName.ForeColor = System.Drawing.Color.Gray;
            //lblDate.ForeColor = System.Drawing.Color.Gray;
            // }

            HtmlControl dvRecom = (HtmlControl)e.Item.FindControl("dvRecom");
            dvRecom.Style.Add("display", "block");
            //  lblMessesage.CssClass += "un-anchor";
        }
        else if (e.CommandName == "DoReply")
        {
            divSuccessMess.Style.Add("display", "none");
            objRecmndDO.intMessageId = Convert.ToInt32(hdnMessId.Value);//Convert.ToInt32(hdnAddedBy.Value);
            ViewState["MessageId"]   = objRecmndDO.intMessageId;
            //   objRecmndDA.Scrl_AddEditDelRecommendations(objRecmndDO, DA_Scrl_UserRecommendation.Scrl_UserRecommendation.UpdateIsRead);
            dt = objRecmndDA.GetDataTable(objRecmndDO, DA_Scrl_UserRecommendation.Scrl_UserRecommendation.GetMessageDetaisByMessId);
            if (dt.Rows.Count > 0)
            {
                ViewState["GrpId"] = hdnGrpId.Value;
                lblTo.Text         = Convert.ToString(dt.Rows[0]["Name"]) + "  [" + Convert.ToString(dt.Rows[0]["vchrUserName"]) + "]";
                lblFrom.Text       = Convert.ToString(dt.Rows[0]["Name"]) + "  [" + Convert.ToString(dt.Rows[0]["vchrUserName"]) + "]";
            }
            dvPopup.Style.Add("display", "block");
        }
    }
Exemple #53
0
    private void displayTable(object sender, EventArgs e, String s)
    {
        //initial set up...Counter for the number of rows, and 
        int countTotalJobs = 0;
        String connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["DBConnectionString"].ConnectionString;
        System.Data.SqlClient.SqlConnection sc = new System.Data.SqlClient.SqlConnection(connectionString);
        sc.Open();

        System.Data.SqlClient.SqlCommand countJobPostings = new System.Data.SqlClient.SqlCommand();



        //This indicates that all interest groups were selected/default!
        if (s.Equals(" "))
        {
            //default
            countJobPostings.CommandText = "SELECT count( SchoolApproval.OpportunityEntityID) FROM OpportunityEntity INNER JOIN SchoolApproval ON " +
                "OpportunityEntity.OpportunityEntityID = SchoolApproval.OpportunityEntityID where OpportunityEntity.OpportunityType = 'JOB' and schoolApproval.approvedflag = 'Y'" +
                " and SchoolApproval.SchoolEntityID = " + Session["schoolID"];


        }
        //This indicates that there were some interest groups that were selected in the drop down menu
        else
        {
            //have to utilize distinct due to the nature of data duplication with interest groups. Cannot have two cards that are exactly the same
            countJobPostings.CommandText = "SELECT COUNT(DISTINCT OpportunityEntity.OpportunityEntityID) AS Expr1 FROM OpportunityEntity INNER JOIN " +
                "OpportunityInterestGroups ON OpportunityEntity.OpportunityEntityID = OpportunityInterestGroups.OpportunityEntityID INNER JOIN  " +
                "InterestGroups ON OpportunityInterestGroups.InterestGroupID = InterestGroups.InterestGroupID INNER JOIN " +
                "SchoolApproval ON OpportunityEntity.OpportunityEntityID = SchoolApproval.OpportunityEntityID WHERE(OpportunityEntity.OpportunityType = 'JOB') " +
                "AND(SchoolApproval.SchoolEntityID = 12) AND(SchoolApproval.ApprovedFlag = 'Y') and (" + s + ")";

        }

        String test = s;

        countJobPostings.Connection = sc;
        System.Data.SqlClient.SqlDataReader reader = countJobPostings.ExecuteReader();




        while (reader.Read())
        {
            countTotalJobs = reader.GetInt32(0);
        }

        sc.Close();




        sc.Open();


        System.Data.SqlClient.SqlCommand pullJobInfo = new System.Data.SqlClient.SqlCommand();

        if (s.Equals(" "))
        {
            pullJobInfo.CommandText = "SELECT  Organization.OrganizationName, JobListing.JobTitle, JobListing.JobDescription," +
            " Organization.Image, Organization.ExternalLink, JobListing.Location, JobListing.Deadline, JobListing.NumOfApplicants, Organization.OrganizationDescription," +
            " JobListing.JobListingID FROM SchoolApproval INNER JOIN OpportunityEntity ON SchoolApproval.OpportunityEntityID = OpportunityEntity.OpportunityEntityID INNER JOIN JobListing" +
            " ON OpportunityEntity.OpportunityEntityID = JobListing.JobListingID INNER JOIN Organization ON JobListing.OrganizationID = Organization.OrganizationEntityID " +
            "where SchoolApproval.ApprovedFlag = 'Y' and OpportunityEntity.OpportunityType = 'JOB' and SchoolApproval.SchoolEntityID = " + Session["schoolID"];

        }
        else
        {
            pullJobInfo.CommandText = "SELECT distinct Organization.OrganizationName, JobListing.JobTitle, JobListing.JobDescription, Organization.Image, " +
                "Organization.ExternalLink, JobListing.Location, JobListing.Deadline, JobListing.NumOfApplicants, Organization.OrganizationDescription, " +
                "JobListing.JobListingID FROM " +
                "SchoolApproval INNER JOIN OpportunityEntity ON SchoolApproval.OpportunityEntityID = OpportunityEntity.OpportunityEntityID INNER JOIN JobListing ON " +
                "OpportunityEntity.OpportunityEntityID = JobListing.JobListingID INNER JOIN Organization ON JobListing.OrganizationID = Organization.OrganizationEntityID INNER JOIN " +
                " OpportunityInterestGroups ON OpportunityEntity.OpportunityEntityID = OpportunityInterestGroups.OpportunityEntityID WHERE(SchoolApproval.ApprovedFlag = 'Y') AND OpportunityEntity.OpportunityType = 'JOB' and " +
                "(SchoolApproval.SchoolEntityID = 12) and (" + s + ")";

        }



        pullJobInfo.Connection = sc;



        reader = pullJobInfo.ExecuteReader();

        {

            //Make the list
            List<JobListing> jobs = new List<JobListing>();


            int jobListingID;
            String orgName;
            String jobTitle;
            String jobDescription;
            String image;
            String link;
            String jobLocation;
            int numOfApplicants;
            String organizationDescription;
            DateTime deadline;


            int x = 0;
            while (reader.Read())
            {

                orgName = reader.GetString(0);
                jobTitle = reader.GetString(1);
                jobDescription = reader.GetString(2);
                image = reader.GetString(3);
                link = reader.GetString(4);
                jobLocation = reader.GetString(5);
                deadline = reader.GetDateTime(6);
                numOfApplicants = reader.GetInt32(7);
                organizationDescription = reader.GetString(8);
                jobListingID = reader.GetInt32(9);
                x++;

                JobListing job = new JobListing(jobTitle, jobDescription, jobLocation, deadline, numOfApplicants, orgName, organizationDescription,
                    image, link);
                //Set this to be used later
                job.setID(jobListingID);
                //Make the object
                //Add to list
                jobs.Add(job);

            }
            sc.Close();
            double doubleRows = countTotalJobs / 3.0;
            int numrows = (int)(Math.Ceiling(doubleRows));
            int numcells = 3;
            int count = 0;
            for (int j = 0; j < numrows; j++)
            {
                TableRow r = new TableRow();


                for (int i = 0; i < numcells; i++)
                {
                    if (count == countTotalJobs)
                    {
                        break;
                    }
                    TableCell c = new TableCell();

                    LinkButton referralLink = new LinkButton();
                    referralLink.ID = "referralLink" + count;

                    referralLink.CssClass = "far fa-paper-plane";

                    referralLink.CommandArgument += jobs[count].getID();
                    referralLink.Command += new CommandEventHandler(this.referralButton_Click);

                    c.Controls.Add(new LiteralControl("<div class='image-flip' ontouchstart='this.classList.toggle('hover');'>"));
                    c.Controls.Add(new LiteralControl("<div class='mainflip'>"));
                    c.Controls.Add(new LiteralControl("<div class='frontside'>"));
                    c.Controls.Add(new LiteralControl("<div class='card'>"));
                    c.Controls.Add(new LiteralControl("<div class='card-body text-center'>"));
                    c.Controls.Add(new LiteralControl("<p><img class='img-fluid' src='" + jobs[count].getOrgImage() + "' alt='card image'></p>"));
                    c.Controls.Add(new LiteralControl("<h4 class='card-title'>" + jobs[count].getOrgName() + "</h4>"));
                    c.Controls.Add(new LiteralControl("<p class='card-text'>" + jobs[count].getJobTitle() + "</p>"));
                    c.Controls.Add(new LiteralControl("<a href='#' class='btn btn-primary btn-sm'><i class='fa fa-plus'></i></a>"));
                    c.Controls.Add(new LiteralControl("</div>"));
                    c.Controls.Add(new LiteralControl("</div>"));
                    c.Controls.Add(new LiteralControl("</div>"));

                    c.Controls.Add(new LiteralControl("<div class='backside'>"));
                    c.Controls.Add(new LiteralControl("<div class='card'>"));
                    c.Controls.Add(new LiteralControl("<div class='card-body text-center'>"));
                    c.Controls.Add(new LiteralControl("<h4 class='card-title'>" + jobs[count].getOrgName() + "</h4>"));
                    c.Controls.Add(new LiteralControl("<p class='card-text'>" + jobs[count].getJobTitle() + "</p>"));
                    c.Controls.Add(new LiteralControl("<p class='card-text'> Location: " + jobs[count].getJobLocation() + "</p>"));
                    c.Controls.Add(new LiteralControl("<p class='card-text'>  Deadline: " + jobs[count].getJobDeadline().ToString() + "</p>"));
                    c.Controls.Add(new LiteralControl("<p class='card-text'>  Number of Applicants: " + jobs[count].getNumOfApplicants() + "</p>"));
                    c.Controls.Add(new LiteralControl("<ul class='list-inline'>"));
                    c.Controls.Add(new LiteralControl("<li class='list-inline-item'>"));
                    c.Controls.Add(new LiteralControl("<a class='social-icon text-xs-center' target='_blank' href='" + jobs[count].getOrgWebsite() + "'>"));
                    c.Controls.Add(new LiteralControl("<i class='fas fa-external-link-alt'></i>&nbsp;&nbsp;&nbsp;"));
                    //c.Controls.Add(referralLink);
                    c.Controls.Add(new LiteralControl("</a>"));
                    c.Controls.Add(new LiteralControl("</li>"));
                    c.Controls.Add(new LiteralControl("</ul>"));
                    c.Controls.Add(new LiteralControl("</div>"));
                    c.Controls.Add(new LiteralControl("</div>"));
                    c.Controls.Add(new LiteralControl("</div>"));
                    c.Controls.Add(new LiteralControl("</div>"));
                    c.Controls.Add(new LiteralControl("</div>"));

                    c.Style.Add("width", "33%");
                    r.Cells.Add(c);
                    count++;

                }
                jobPostingTable.Rows.Add(r);
            }


        }
    }
    protected void dgvGridView_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
    {
        if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
        {
            clsEncryption objEncrypt    = new clsEncryption();
            int           intHiddenPKID = 0;

            if (!string.IsNullOrEmpty(hdnPKID.Value))
            {
                intHiddenPKID = Convert.ToInt32(hdnPKID.Value);
            }

            objCommon     = new clsCommon();
            hdnPKID.Value = e.CommandArgument.ToString();
            if (e.CommandName == "Up")
            {
                LinkButton inkButton = (LinkButton)e.CommandSource;

                GridViewRow drCurrent = (GridViewRow)inkButton.Parent.Parent;

                if (drCurrent.RowIndex > 0)
                {
                    GridViewRow drUp = dgvGridView.Rows[drCurrent.RowIndex - 1];
                    objCommon.SetDisplayOrder("tblMenuItemType", tblMenuItemType.ColumnNames.AppMenuItemTypeID, tblMenuItemType.ColumnNames.AppDisplayOrder, (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[1], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[0], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[1]);
                    hdnPKID.Value = intHiddenPKID.ToString();
                    LoadDataGrid(false, false);
                    objCommon = null;
                }

                hdnPKID.Value = intHiddenPKID.ToString();
            }
            else if (e.CommandName == "Down")
            {
                LinkButton lnkButton = (LinkButton)e.CommandSource;

                GridViewRow drCurrent = (GridViewRow)lnkButton.Parent.Parent;

                if (drCurrent.RowIndex < dgvGridView.Rows.Count - 1)
                {
                    GridViewRow drUp = dgvGridView.Rows[drCurrent.RowIndex + 1];
                    objCommon.SetDisplayOrder("tblMenuItemType", tblMenuItemType.ColumnNames.AppMenuItemTypeID, tblMenuItemType.ColumnNames.AppDisplayOrder, (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[0], (int)dgvGridView.DataKeys[drCurrent.RowIndex].Values[1], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[0], (int)dgvGridView.DataKeys[drUp.RowIndex].Values[1]);
                    hdnPKID.Value = intHiddenPKID.ToString();
                    LoadDataGrid(false, false);
                    objCommon = null;
                }

                hdnPKID.Value = intHiddenPKID.ToString();
            }
            else if (e.CommandName == "IsActive")
            {
                objMenuItemType = new tblMenuItemType();

                if (objMenuItemType.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)))
                {
                    if (objMenuItemType.AppIsActive)
                    {
                        objMenuItemType.AppIsActive = false;
                    }
                    else
                    {
                        objMenuItemType.AppIsActive = true;
                    }

                    objMenuItemType.Save();
                    LoadDataGrid(false, false, "", "");
                }
            }
        }
    }
        /// <summary>
        /// InstantiateIn instantiates the template (implementation of ITemplate)
        /// </summary>
        /// <remarks>
        /// </remarks>
        ///	<param name="container">The parent container (DataGridItem)</param>
        public void InstantiateIn(Control container)
        {
            switch (ItemType)
            {
            case GridItemType.Item:
            case GridItemType.AlternatingItem:
            case GridItemType.SelectedItem:
            case GridItemType.EditItem:
                if (EditMode == ImageCommandColumnEditMode.URL)
                {
                    var hypLink = new HyperLink {
                        ToolTip = Text
                    };
                    if (!String.IsNullOrEmpty(ImageURL) && ShowImage)
                    {
                        var img = new Image {
                            ImageUrl = DesignMode ? ImageURL.Replace("~/", "../../") : ImageURL
                        };
                        hypLink.Controls.Add(img);
                        img.ToolTip = Text;
                    }
                    else
                    {
                        hypLink.Text = Text;
                    }
                    hypLink.DataBinding += ItemDataBinding;
                    container.Controls.Add(hypLink);
                }
                else
                {
                    if (!String.IsNullOrEmpty(ImageURL) && ShowImage)
                    {
                        var colIcon = new ImageButton
                        {
                            ImageUrl = DesignMode ? ImageURL.Replace("~/", "../../") : ImageURL, ToolTip = Text
                        };
                        if (!String.IsNullOrEmpty(OnClickJs))
                        {
                            ClientAPI.AddButtonConfirm(colIcon, OnClickJs);
                        }
                        colIcon.CommandName  = CommandName;
                        colIcon.DataBinding += ItemDataBinding;
                        container.Controls.Add(colIcon);
                    }
                    if (!String.IsNullOrEmpty(Text) && !ShowImage)
                    {
                        var colLink = new LinkButton {
                            ToolTip = Text
                        };
                        if (!String.IsNullOrEmpty(OnClickJs))
                        {
                            ClientAPI.AddButtonConfirm(colLink, OnClickJs);
                        }
                        colLink.CommandName  = CommandName;
                        colLink.Text         = Text;
                        colLink.DataBinding += ItemDataBinding;
                        container.Controls.Add(colLink);
                    }
                }
                break;

            case GridItemType.Footer:
            case GridItemType.Header:
                container.Controls.Add(new LiteralControl(Text));
                break;
            }
        }
        public void gvOnProfileRowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
        {
            if ((!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Header.ToString())) & (!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Footer.ToString())))
            {
                try
                {
                    CheckBox    cb;
                    Label       lbl;
                    Image       img = (Image)e.Row.Cells[0].FindControl("imgHazardType");
                    HiddenField hf  = (HiddenField)e.Row.Cells[0].FindControl("hfMetricPrompt");

                    if (!string.IsNullOrEmpty(hf.Value))
                    {
                        lbl         = (Label)e.Row.Cells[0].FindControl("lblMetricPrompt");
                        lbl.Visible = true;
                        lbl.Text    = "<br>" + hf.Value;
                    }

                    hf = (HiddenField)e.Row.Cells[0].FindControl("hfMetricCategory");
                    if (hf.Value == "ENGY" || hf.Value == "EUTL")
                    {
                        e.Row.Cells[0].CssClass = e.Row.Cells[1].CssClass = "energyColor";
                        img.ImageUrl            = "~/images/status/energy.png";
                    }
                    else if (hf.Value == "PROD" || hf.Value == "SAFE" || hf.Value == "FACT")
                    {
                        img.ImageUrl = "~/images/status/inputs.png";
                        img.ToolTip  = WebSiteCommon.GetXlatValueLong("measureCategoryEHS", hf.Value);
                    }
                    else
                    {
                        e.Row.Cells[0].CssClass = e.Row.Cells[1].CssClass = "wasteColor";
                        hf = (HiddenField)e.Row.Cells[0].FindControl("hfMetricRegStatus");

                        if (hf.Value == "HZ")
                        {
                            img.ImageUrl = "~/images/status/hazardous.png";
                        }
                        else
                        {
                            img.ImageUrl = "~/images/status/waste.png";
                        }
                        img.ToolTip = WebSiteCommon.GetXlatValueLong("regulatoryStatus", hf.Value);
                        hf          = (HiddenField)e.Row.Cells[0].FindControl("hfDisposalCode");
                        if (!string.IsNullOrEmpty(hf.Value))
                        {
                            img.ToolTip += (".  " + SessionManager.DisposalCodeList.FirstOrDefault(l => l.UN_CODE == hf.Value).DESCRIPTION);
                        }
                    }
                    //      e.Row.Cells[0].Attributes.Add("Style", "background: wheat;");

                    hf = (HiddenField)e.Row.Cells[0].FindControl("hfMetricStatus");
                    if (hf.Value == "I")
                    {
                        img          = (Image)e.Row.Cells[0].FindControl("imgStatus");
                        img.ImageUrl = "/images/defaulticon/16x16/no.png";
                        img.Visible  = true;
                        cb           = (CheckBox)e.Row.Cells[0].FindControl("cbMetricRequired");
                        cb.Visible   = false;
                    }

                    LinkButton lnk  = (LinkButton)e.Row.Cells[0].FindControl("lnkMetricCD");
                    LinkButton lnk2 = (LinkButton)e.Row.Cells[0].FindControl("lnkMetricName");
                    lnk.ToolTip = lnk2.ToolTip = WebSiteCommon.GetXlatValue("measureCategoryEHS", hf.Value);

                    cb = (CheckBox)e.Row.Cells[0].FindControl("cbMetricRequired");
                    hf = (HiddenField)e.Row.Cells[0].FindControl("hfMetricRequired");
                    if (!string.IsNullOrEmpty(hf.Value))
                    {
                        try
                        {
                            cb.Checked = Convert.ToBoolean(hf.Value);
                        }
                        catch
                        { }
                    }

                    lbl = (Label)e.Row.Cells[0].FindControl("lblInvoiceType");
                    hf  = (HiddenField)e.Row.Cells[0].FindControl("hfMetricCategory");
                    if (hf.Value == "SAFE" || hf.Value == "PROD" || hf.Value == "FACT")
                    {
                        lbl.Text = "";
                    }
                    else
                    {
                        if (lbl.Text == "True")
                        {
                            lbl.Text = WebSiteCommon.GetXlatValue("costType", "CREDIT", "short");
                        }
                        else
                        {
                            lbl.Text = WebSiteCommon.GetXlatValue("costType", "COST", "short");
                        }
                    }

                    lbl = (Label)e.Row.Cells[0].FindControl("lblInvoiceUOM");
                    if (!string.IsNullOrEmpty(lbl.Text))
                    {
                        decimal uomID = Convert.ToDecimal(lbl.Text);
                        lbl.Text = SessionManager.UOMList.Where(l => l.UOM_ID == uomID).Select(u => u.UOM_NAME).FirstOrDefault().ToString();
                    }
                }
                catch
                {
                }
            }
        }
Exemple #57
0
        protected void lnkTask_Click(object sender, EventArgs e)
        {
            string cmd = "";

            if (sender is ImageButton)
            {
                ImageButton btn = (ImageButton)sender;
                cmd = btn.CommandArgument.ToString().Trim();
            }
            else
            {
                LinkButton lnk = (LinkButton)sender;
                cmd = lnk.CommandArgument.ToString().Trim();
            }

            if (OnTaskListClick != null)
            {
                OnTaskListClick(cmd);
            }
            else
            {
                string[]       args     = cmd.Split('|');
                TaskRecordType taskType = (TaskRecordType)Enum.Parse(typeof(TaskRecordType), args[0]);
                switch (taskType)
                {
                case TaskRecordType.QualityIssue:
                    QI_OCCUR qiOccur = new QI_OCCUR();
                    qiOccur.INCIDENT_ID         = Convert.ToDecimal(args[1]);
                    SessionManager.ReturnObject = qiOccur;
                    SessionManager.ReturnStatus = true;
                    SessionManager.ReturnPath   = Request.Url.PathAndQuery;
                    Response.Redirect("/Quality/Quality_Issue.aspx?c=" + args[2]);
                    break;

                case TaskRecordType.ProblemCase:
                    try
                    {
                        //string[] datas = args[1].Split('~');
                        TASK_STATUS task = new TASK_STATUS();
                        task.RECORD_ID = Convert.ToDecimal(args[1]);
                        task.TASK_STEP = args[2];
                        SessionManager.ReturnObject = task;
                        SessionManager.ReturnStatus = true;
                        SessionManager.ReturnPath   = Request.Url.PathAndQuery;
                        Response.Redirect("/Problem/Problem_Case.aspx");
                    }
                    catch (Exception ex)
                    {
                        //SQMLogger.LogException(ex);
                    }
                    break;

                case TaskRecordType.ProfileInput:
                case TaskRecordType.ProfileInputApproval:
                    SessionManager.ReturnObject = args[1];
                    SessionManager.ReturnStatus = true;
                    SessionManager.ReturnPath   = Request.Url.PathAndQuery;
                    Response.Redirect("/EHS/EHS_MetricInput.aspx");
                    break;

                case TaskRecordType.ProfileInputFinalize:
                    SessionManager.ReturnObject = args[1];
                    SessionManager.ReturnStatus = true;
                    SessionManager.ReturnPath   = Request.Url.PathAndQuery;
                    Response.Redirect("/EHS/EHS_Console.aspx");
                    break;
                    break;

                case TaskRecordType.HealthSafetyIncident:
                    SessionManager.ReturnObject = args[1];
                    SessionManager.ReturnStatus = true;
                    SessionManager.ReturnPath   = Request.Url.PathAndQuery;
                    Response.Redirect("/EHS/EHS_Incidents.aspx");
                    break;

                case TaskRecordType.PreventativeAction:
                    SessionManager.ReturnObject = args[1];
                    SessionManager.ReturnStatus = true;
                    SessionManager.ReturnPath   = Request.Url.PathAndQuery;
                    Response.Redirect("/EHS/EHS_Incidents.aspx?mode=prevent");
                    break;

                case TaskRecordType.CurrencyInput:
                    SessionManager.ReturnObject = args[1];
                    SessionManager.ReturnStatus = true;
                    SessionManager.ReturnPath   = Request.Url.PathAndQuery;
                    Response.Redirect("/Admin/Administrate_CurrencyInput.aspx");
                    break;

                default:
                    break;
                }
            }
        }
 public CourseMaterialControls(FileUpload fup, CheckBox chk, LinkButton lnk)
 {
     this.FileUploader = fup;
     this.Checkbox     = chk;
     this.FileLink     = lnk;
 }
Exemple #59
0
        /// <summary>
        /// Handles the Click event of the btnNext control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        protected void btnNext_Click(object sender, EventArgs e)
        {
            int pageNumber = hfPageNo.ValueAsInt() + 1;

            GetResponse();

            LinkButton btn             = ( LinkButton )sender;
            string     commandArgument = btn.CommandArgument;

            var totalQuestion = pageNumber * QuestionCount;

            if ((_assessmentResponses.Count > totalQuestion && !_assessmentResponses.All(a => a.Response.HasValue)) || "Next".Equals(commandArgument))
            {
                BindRepeater(pageNumber);
            }
            else
            {
                MotivatorService.AssessmentResults result = MotivatorService.GetResult(_assessmentResponses.ToDictionary(a => a.Code, b => b.Response.Value));
                MotivatorService.SaveAssessmentResults(_targetPerson, result);
                var rockContext = new RockContext();

                var        assessmentService = new AssessmentService(rockContext);
                Assessment assessment        = null;

                if (hfAssessmentId.ValueAsInt() != 0)
                {
                    assessment = assessmentService.Get(int.Parse(hfAssessmentId.Value));
                }

                if (assessment == null)
                {
                    var assessmentType = new AssessmentTypeService(rockContext).Get(Rock.SystemGuid.AssessmentType.MOTIVATORS.AsGuid());
                    assessment = new Assessment()
                    {
                        AssessmentTypeId = assessmentType.Id,
                        PersonAliasId    = _targetPerson.PrimaryAliasId.Value
                    };
                    assessmentService.Add(assessment);
                }

                assessment.Status               = AssessmentRequestStatus.Complete;
                assessment.CompletedDateTime    = RockDateTime.Now;
                assessment.AssessmentResultData = new { Result = result.AssessmentData, TimeToTake = RockDateTime.Now.Subtract(StartDateTime).TotalSeconds }.ToJson();
                rockContext.SaveChanges();

                // Since we are rendering chart.js we have to register the script or reload the page.
                if (_assessmentId == 0)
                {
                    var removeParams = new List <string>
                    {
                        PageParameterKey.AssessmentId
                    };

                    NavigateToCurrentPageReferenceWithRemove(removeParams);
                }
                else
                {
                    this.NavigateToCurrentPageReference();
                }
            }
        }