Example #1
0
        protected void RadGrid1_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
            System.Data.DataSet         ds       = (System.Data.DataSet)ViewState["DATA.RESULT"];
            Telerik.Web.UI.GridDataItem dataItem = (Telerik.Web.UI.GridDataItem)e.DetailTableView.ParentItem;
            string kdInduk = dataItem.GetDataKeyValue("ID_IKU").ToString();

            DataTable dt = ds.Tables[1].Select("ID_IKU = " + kdInduk).CopyToDataTable();

            e.DetailTableView.DataSource = dt;
        }
Example #2
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);
        }
    }
Example #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;
                }
            }
        }
Example #4
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;
                int parentId = Convert.ToInt32(item.GetDataKeyValue("ParentId"));

                if (!appliedFilter && parentId > 0)
                {
                    item.Font.Italic = true;
                }
            }
        }
Example #5
0
    protected void po_accept_headOfDepartmentCB_CheckedChanged(object sender, EventArgs e)
    {
        CheckBox cb = (CheckBox)sender;

        Telerik.Web.UI.GridDataItem item = (Telerik.Web.UI.GridDataItem)((Control)sender).NamingContainer;

        string po_id = item.GetDataKeyValue("po_id").ToString();

        try
        {
            using (SqlConnection con = new SqlConnection(Controller.connection))
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    con.Open();

                    Dictionary <string, string> fields = new Dictionary <string, string>();
                    fields.Add("po_date_headOfDepartment", DateTime.Now.ToString());

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

                    if (cb.Checked == true)
                    {
                        fields.Add("po_accept_headOfDepartment", true.ToString());
                        fields.Add("po_isnewforHOD", false.ToString());
                        Controller.Update(cmd, con, "CNRS_PurchaseOrder", fields, conditions);
                    }
                    else
                    {
                        fields.Add("po_accept_headOfDepartment", false.ToString());
                        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);
        }
    }