Beispiel #1
0
    protected void po_date_end_technicalOfficerRCB_Click(object sender, EventArgs e)
    {
        try
        {
            CheckBox rcb = (CheckBox)sender;
            Telerik.Web.UI.GridDataItem item = (Telerik.Web.UI.GridDataItem)((Control)sender).NamingContainer;

            string po_id              = item.GetDataKeyValue("po_id").ToString();
            string user_email         = ((Label)item.FindControl("user_emailLBL")).Text;
            string user_contactPerson = ((Label)item.FindControl("user_contactPersonLBL")).Text;


            Dictionary <string, string> fields     = new Dictionary <string, string>();
            Dictionary <string, string> conditions = new Dictionary <string, string>();
            conditions.Add("po_id", po_id);

            if (rcb.Checked == true)
            {
                fields.Add("po_date_end_technicalOfficer", DateTime.Now.ToString());
                fields.Add("po_isnewforTechmical", false.ToString());
            }
            else
            {
                fields.Add("po_date_end_technicalOfficer", DBNull.Value.ToString());
            }

            bool sendedEmail = false;
            if (rcb.Checked == true)
            {
                sendedEmail = SendEmail(user_email, user_contactPerson, 1);
            }
            else
            {
                sendedEmail = SendEmail(user_email, user_contactPerson, 2);
            }

            using (SqlConnection con = new SqlConnection(Controller.connection))
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    con.Open();
                    if (sendedEmail == true)
                    {
                        Controller.Update(cmd, con, "CNRS_PurchaseOrder", fields, conditions);
                        AlertJS();
                        RadGridBoxes.Rebind();
                    }
                }
            }
        }
        catch (Exception ex)
        {
            Controller.SaveErrors(Path.GetFileName(Request.PhysicalPath), ex.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name);
        }
    }
Beispiel #2
0
 protected void Print_Click(object sender, EventArgs e)
 {
     try
     {
         RadButton LBTN    = (RadButton)sender;
         string    po_id   = LBTN.CommandArgument;
         var       encrypt = new eXSecurity.Encryption();
         Telerik.Web.UI.GridDataItem dataItem = (Telerik.Web.UI.GridDataItem)((Control)sender).NamingContainer;
         string item_id = ((Label)dataItem.FindControl("item_idLBL")).Text;
         if (item_id == "1") //TLD
         {
             Response.Write("<script>");
             Response.Write("window.open('Reports/TLDReport.aspx?P=" + encrypt.EncryptData(po_id) + "')");
             Response.Write("</script>");
         }
         else if (item_id == "2") //SSDL
         {
             Response.Write("<script>");
             Response.Write("window.open('Reports/SSDLReport.aspx?P=" + encrypt.EncryptData(po_id) + "')");
             Response.Write("</script>");
         }
     }
     catch (Exception ex)
     {
         Controller.SaveErrors(Path.GetFileName(Request.PhysicalPath), ex.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name);
     }
 }
Beispiel #3
0
        void grid_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is Telerik.Web.UI.GridDataItem)
            {
                Telerik.Web.UI.GridDataItem item = (Telerik.Web.UI.GridDataItem)e.Item;
                HyperLink    lnkQuickView        = (HyperLink)item.FindControl("lnkQuickView");
                DropDownList ddOrderStatus       = (DropDownList)item.FindControl("ddOrderStatus");
                int          orderId             = Convert.ToInt32(item.GetDataKeyValue("OrderId"));
                int          orderStatus         = Convert.ToInt32(item.GetDataKeyValue("OrderStatus"));

                RadToolTipManager1.TargetControls.Add(lnkQuickView.ClientID, orderId.ToString(), true);

                PopulateOrderStatus(ddOrderStatus, false);
                ListItem li = ddOrderStatus.Items.FindByValue(orderStatus.ToString());
                if (li != null)
                {
                    ddOrderStatus.ClearSelection();
                    li.Selected = true;
                }
            }
        }
Beispiel #4
0
    //***

    protected void Next_Click(object sender, EventArgs e)
    {
        try
        {
            LinkButton LBTN  = (LinkButton)sender;
            string     po_id = LBTN.CommandArgument;
            Telerik.Web.UI.GridDataItem dataItem = (Telerik.Web.UI.GridDataItem)((Control)sender).NamingContainer;
            Label item_id = (Label)dataItem.FindControl("item_idLBL");

            NavigateNextStep(item_id.Text, po_id, 1);
        }
        catch (Exception ex)
        {
            Controller.SaveErrors(Path.GetFileName(Request.PhysicalPath), ex.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name);
        }
    }
Beispiel #5
0
        protected void LnkViewRoles_Click(object sender, EventArgs e)
        {
            BindRoles(ChkRolesList);
            string sLoginID = Convert.ToString(((LinkButton)sender).CommandArgument);

            TxtHdnLoginID.Text = sLoginID;

            LinkButton LnkView = ((LinkButton)sender);

            Telerik.Web.UI.GridDataItem gr = (Telerik.Web.UI.GridDataItem)LnkView.NamingContainer;
            string fname = (gr.FindControl("LblFirstName") as Label).Text;

            // string lname = (gr.FindControl("LblLastName") as Label).Text;

            // LblPopupUserName.Text = "View Roles For : " + Convert.ToString(fname + " " + lname);
            LblPopupUserName.Text = "View Roles For : " + Convert.ToString(fname);
            CheckUserRoles(Convert.ToString(sLoginID));
            ModalPopupExtender1.Show();
        }