示例#1
0
        protected void RadGridFieldName_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridDataItem && e.Item.OwnerTableView.Name == "ChildGrid")
            {
                GridDataItem item           = (GridDataItem)e.Item;
                Label        lblControlFlag = (Label)item.FindControl("lblControlFlag");


                //Telerik.Web.UI.RadButton btnradRadioButtonList = (Telerik.Web.UI.RadButton)item.FindControl("btnRadRadiolist");
                RadButton rbtnYesNo = (RadButton)item.FindControl("rbtnYesNo");
                Telerik.Web.UI.RadTextBox txtRadText  = (Telerik.Web.UI.RadTextBox)item.FindControl("txtRadText");
                RadDatePicker             dtDateValue = (RadDatePicker)item.FindControl("dtDateValue");

                rbtnYesNo.Visible   = false;
                txtRadText.Visible  = false;
                dtDateValue.Visible = false;

                if (lblControlFlag.Text == "Text SingleLine")
                {
                    txtRadText.Visible = true;
                }

                else if (lblControlFlag.Text == "Date")
                {
                    dtDateValue.Visible = true;
                }
            }
        }
        protected void RadOtherVaccine_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (ViewState["TblImmunisation"] == null)
            {
                DtImmunisation = CreateImmunisationTable();
            }
            else
            {
                DtImmunisation = (DataTable)ViewState["TblImmunisation"];
            }
            DataRow DR = DtImmunisation.NewRow();

            int dtnextId = Convert.ToInt32(DtImmunisation.Rows.Count) + 1;


            if (e.CommandName == "Insert")
            {
                if (RadOtherVaccine != null)
                {
                    // GridItem[] footerItems = RadOtherVaccine.MasterTableView.GetItems(GridItemType.Footer);
                    GridFooterItem footeritem = (GridFooterItem)RadOtherVaccine.MasterTableView.GetItems(GridItemType.Footer)[0];



                    if (footeritem != null)
                    {
                        Telerik.Web.UI.RadTextBox    txtimmuOther           = (Telerik.Web.UI.RadTextBox)footeritem.FindControl("txtFooterRadVaccineName");
                        Telerik.Web.UI.RadButton     btnFooterOthers        = (Telerik.Web.UI.RadButton)footeritem.FindControl("btnFooterOthers");
                        Telerik.Web.UI.RadButton     btnCatchupFooterOthers = (Telerik.Web.UI.RadButton)footeritem.FindControl("btnCatchupFooterOthers");
                        Telerik.Web.UI.RadDatePicker dtFooterOtherDate      = (Telerik.Web.UI.RadDatePicker)footeritem.FindControl("dtFooterOtherDate");

                        if (ValidateAddImmunisation(txtimmuOther.Text.ToString(), dtFooterOtherDate.SelectedDate, btnFooterOthers.SelectedToggleState.Text.ToString()) == false)
                        {
                            RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "JumpToGrid", "document.location = '#sGrid';", true);
                            return;
                        }


                        DR["ImmunisationOther"] = txtimmuOther.Text;
                        DR["ImmunisationDate"]  = Convert.ToDateTime(dtFooterOtherDate.SelectedDate.ToString()).ToShortDateString();
                        DR["ImmunisationCU"]    = btnCatchupFooterOthers.SelectedToggleState.Text;
                        DR["Administered"]      = btnFooterOthers.SelectedToggleState.Text;
                        DR["ID"]       = dtnextId.ToString() + txtimmuOther.Text;
                        DR["EditMode"] = "DELETE";
                        DtImmunisation.Rows.Add(DR);
                        ViewState["TblImmunisation"] = DtImmunisation;
                        RadOtherVaccine.DataSource   = DtImmunisation;
                        RadOtherVaccine.DataBind();
                    }
                }
            }


            //GridDataItem row = RadGrid1.Items[rowNo];
        }
示例#3
0
 protected void gvRules_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
 {
     if (e.CommandName == "Update")
     {
         Telerik.Web.UI.RadTextBox txt = (Telerik.Web.UI.RadTextBox)e.Item.FindControl("txtRuleDescription");
         DataTable objDT;
         objDT = (DataTable)Session["DT_Rules"];
         Session["DT_Rules"] = setValue(objDT, e.CommandArgument.ToString(), txt.Text.Trim().ToString());
         gvRules.Rebind();
     }
 }
        protected void RadGridFieldName_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridDataItem && e.Item.OwnerTableView.Name == "ChildGrid")
            {
                GridDataItem item                    = (GridDataItem)e.Item;
                Label        lblConditionName        = (Label)item.FindControl("lblConditionName");
                Telerik.Web.UI.RadTextBox txtRemakrs = (Telerik.Web.UI.RadTextBox)item.FindControl("txtRemakrs");
                txtRemakrs.Visible = false;
                if (lblConditionName.Text.ToString().ToUpper() == "OTHER")
                {
                    txtRemakrs.Visible = true;
                }
            }



            //}
        }
        protected void gvComments_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName.ToString().ToUpper() == "UPDATE")
            {
                Telerik.Web.UI.RadTextBox txt = (Telerik.Web.UI.RadTextBox)e.Item.FindControl("txtRuleDescription");
                DataTable objDT = (DataTable)ViewState["ALERTS"];

                BECommon objBECommon = new BECommon();
                BCommon  objBCommon  = new BCommon();
                objBECommon.IntTransID   = Convert.ToInt64(AppSecurity.Decrypt(Request.QueryString["TransID"].ToString()));
                objBECommon.intTypeID    = 1;
                objBECommon.intCommentID = Convert.ToInt32(e.CommandArgument);
                objBECommon.StrComments  = txt.Text.Trim();
                objBCommon.BDeleteUpdateAlerts(objBECommon);
                ViewState["ALERTS"]   = objDT;
                gvComments.DataSource = objDT;
                gvComments.DataBind();
                BindTransactionsComments();
            }
        }
    private List <t_Data_Raw_Indexes> GetIndexes()
    {
        List <t_Data_Raw_Indexes> list = new List <t_Data_Raw_Indexes>();

        foreach (Telerik.Web.UI.GridItem row in grv.Items)
        {
            Telerik.Web.UI.RadTextBox        TextBoxDescription   = row.FindControl("txtDescription") as Telerik.Web.UI.RadTextBox;
            Telerik.Web.UI.RadDatePicker     DatePicker           = row.FindControl("dtmTimeStamp") as Telerik.Web.UI.RadDatePicker;
            Telerik.Web.UI.RadNumericTextBox NummericTextBoxIndex = row.FindControl("nmrIndex") as Telerik.Web.UI.RadNumericTextBox;
            t_Data_Raw_Indexes data = new t_Data_Raw_Indexes();
            if (NummericTextBoxIndex.Value != null && DatePicker.SelectedDate != null)
            {
                data.Description = TextBoxDescription.Text;
                data.Index       = (double)NummericTextBoxIndex.Value;
                data.TimeStamp   = (DateTime)DatePicker.SelectedDate;
                data.SiteId      = cboSites.SelectedValue;
                list.Add(data);
            }
        }
        return(list);
    }
        protected void RadOtherVaccine_UpdateCommand(object sender, GridCommandEventArgs e)
        {
            //GetImmunisationDetails();
            //GetImmunisationDetaisOther();
            //List<BIQTouchmmunisationFields> list1 = new List<BIQTouchmmunisationFields>();

            if (e.CommandName == RadGrid.UpdateCommandName)
            {
                if (e.Item is GridEditFormItem)
                {
                    GridEditFormItem             item                  = (GridEditFormItem)e.Item;
                    Telerik.Web.UI.RadDatePicker dtEditOtherDate       = (Telerik.Web.UI.RadDatePicker)item.FindControl("dtEditOtherDate");
                    Telerik.Web.UI.RadButton     btnCatchupEditOthers  = (Telerik.Web.UI.RadButton)item.FindControl("btnCatchupEditOthers");
                    Telerik.Web.UI.RadTextBox    txtEditRadVaccineName = (Telerik.Web.UI.RadTextBox)item.FindControl("txtEditRadVaccineName");
                    Label lblIDEdit = (Label)item.FindControl("lblIDEdit");

                    string    id    = lblIDEdit.Text;
                    DataTable table = (DataTable)ViewState["TblImmunisation"];
                    table.PrimaryKey = new DataColumn[] { table.Columns["ID"] };

                    if (table.Rows.Find(id) != null)
                    {
                        DataRow dr = table.Rows.Find(id);
                        dr["ImmunisationOther"] = txtEditRadVaccineName.Text.ToString();
                        dr["ImmunisationDate"]  = Convert.ToDateTime(dtEditOtherDate.SelectedDate.ToString()).ToShortDateString();
                        dr["ImmunisationCU"]    = CheckedVaue(btnCatchupEditOthers.SelectedToggleState.Text);
                        dr["EditMode"]          = "New";


                        table.AcceptChanges();
                        ViewState["TblImmunisation"] = table;
                        RadOtherVaccine.DataSource   = table;
                        RadOtherVaccine.DataBind();
                    }
                }
            }
        }
        protected void RadOtherVaccine_UpdateCommand(object sender, GridCommandEventArgs e)
        {
            GetImmunisationDetails();
            GetImmunisationDetaisOther();
            List <BIQTouchmmunisationFields> list1 = new List <BIQTouchmmunisationFields>();

            if (e.CommandName == RadGrid.UpdateCommandName)
            {
                if (e.Item is GridEditFormItem)
                {
                    GridEditFormItem             item                  = (GridEditFormItem)e.Item;
                    Telerik.Web.UI.RadDatePicker dtEditOtherDate       = (Telerik.Web.UI.RadDatePicker)item.FindControl("dtEditOtherDate");
                    Telerik.Web.UI.RadButton     btnCatchupEditOthers  = (Telerik.Web.UI.RadButton)item.FindControl("btnCatchupEditOthers");
                    Telerik.Web.UI.RadTextBox    txtEditRadVaccineName = (Telerik.Web.UI.RadTextBox)item.FindControl("txtEditRadVaccineName");
                    if (dtEditOtherDate.DbSelectedDate.ToString() != "")
                    {
                        BIQTouchmmunisationFields obj1 = new BIQTouchmmunisationFields();
                        obj1.Ptnpk      = Convert.ToInt32(Request.QueryString["PatientID"]);;
                        obj1.LocationId = Int32.Parse(Session["AppLocationId"].ToString());
                        obj1.UserId     = Int32.Parse(Session["AppUserId"].ToString());
                        obj1.Flag       = 1;

                        obj1.ImmunisationDate  = Convert.ToDateTime(dtEditOtherDate.DbSelectedDate.ToString());
                        obj1.ImmunisationOther = txtEditRadVaccineName.Text;
                        obj1.ImmunisationCU    = CheckedVaue(btnCatchupEditOthers.SelectedToggleState.Text);
                        obj1.ImmunisationCode  = "";
                        list1.Add(obj1);
                    }
                }
                IBIQTouchImmunisation theImmunisationManager;
                theImmunisationManager = (IBIQTouchImmunisation)ObjectFactory.CreateInstance("BusinessProcess.Pharmacy.BImmunisation, BusinessProcess.Pharmacy");
                int result = theImmunisationManager.SaveUpdateImmunisationDetail(list1);
                GetImmunisationDetails();
                GetImmunisationDetaisOther();
            }
        }
示例#9
0
    private void DisableControl(Control objC)
    {
        try
        {
            if (objC is Telerik.Web.UI.RadTextBox)
            {
                Telerik.Web.UI.RadTextBox obj = (Telerik.Web.UI.RadTextBox)objC;
                obj.ReadOnly = true;
            }

            if (objC is Telerik.Web.UI.RadComboBox)
            {
                Telerik.Web.UI.RadComboBox obj = (Telerik.Web.UI.RadComboBox)objC;
                obj.Enabled   = false;
                obj.BackColor = Color.White;
                obj.ForeColor = Color.Black;
            }

            if (objC is Telerik.Web.UI.RadNumericTextBox)
            {
                Telerik.Web.UI.RadNumericTextBox obj = (Telerik.Web.UI.RadNumericTextBox)objC;
                obj.ReadOnly = true;
            }

            if (objC is Telerik.Web.UI.RadDatePicker)
            {
                Telerik.Web.UI.RadDatePicker obj = (Telerik.Web.UI.RadDatePicker)objC;
                obj.Enabled = false;
            }

            if (objC is Telerik.Web.UI.DatePickingCalendar)
            {
                Telerik.Web.UI.DatePickingCalendar obj = (Telerik.Web.UI.DatePickingCalendar)objC;
                obj.Enabled = false;
            }

            if (objC is System.Web.UI.WebControls.RadioButtonList)
            {
                System.Web.UI.WebControls.RadioButtonList obj = (System.Web.UI.WebControls.RadioButtonList)objC;
                obj.Enabled = false;
            }

            if (objC is System.Web.UI.WebControls.TextBox)
            {
                System.Web.UI.WebControls.TextBox obj = (System.Web.UI.WebControls.TextBox)objC;
                obj.ReadOnly = true;
            }

            if (objC is Telerik.Web.UI.RadUpload)
            {
                Telerik.Web.UI.RadUpload obj = (Telerik.Web.UI.RadUpload)objC;
                obj.Enabled = false;
            }

            if (objC is Telerik.Web.UI.RadButton)
            {
                Telerik.Web.UI.RadButton obj = (Telerik.Web.UI.RadButton)objC;
                obj.ReadOnly = true;
            }
        }
        catch (Exception)
        {
            throw;
        }
    }
        protected void RadOtherVaccine_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem dataBoundItem = e.Item as GridDataItem;

                Label lblImmunisationName = (Label)dataBoundItem.FindControl("lblImmunisation_name");

                if (lblImmunisationName.Text.ToString() == "")
                {
                    e.Item.Display = false;
                }
                else
                {
                    Label lblAdministered = (Label)dataBoundItem.FindControl("lblAdministered");
                    Label lblcatchUp      = (Label)dataBoundItem.FindControl("lblcatchUp");
                    Label lblEditMode     = (Label)dataBoundItem.FindControl("lblEditMode");
                    Telerik.Web.UI.RadButton btnOthers        = (Telerik.Web.UI.RadButton)dataBoundItem.FindControl("btnOthers");
                    Telerik.Web.UI.RadButton btnCatchupOthers = (Telerik.Web.UI.RadButton)dataBoundItem.FindControl("btnCatchupOthers");
                    Telerik.Web.UI.RadButton btnRemove        = (Telerik.Web.UI.RadButton)dataBoundItem.FindControl("btnRemove");

                    btnOthers.SetSelectedToggleStateByText(lblAdministered.Text);
                    btnCatchupOthers.SetSelectedToggleStateByText(lblcatchUp.Text);
                    btnRemove.Visible = true;
                    if (lblEditMode.Text.ToString().Trim() == "EDIT")
                    {
                        // Button Enable for EDIT
                        btnRemove.Visible = false;
                    }
                }
            }



            //if (e.Item is GridFooterItem)
            //{

            //    GridFooterItem itemFooter = e.Item as GridFooterItem;
            //    Telerik.Web.UI.RadButton btnFooterAdd = (Telerik.Web.UI.RadButton)itemFooter.FindControl("btnFooterAdd");
            //    Telerik.Web.UI.RadTextBox txtFooterRadVaccineName = (Telerik.Web.UI.RadTextBox)itemFooter.FindControl("txtFooterRadVaccineName");
            //    Telerik.Web.UI.RadDatePicker dtFooterOtherDate = (Telerik.Web.UI.RadDatePicker)itemFooter.FindControl("dtFooterOtherDate");
            //    Telerik.Web.UI.RadButton btnOthers = (Telerik.Web.UI.RadButton)itemFooter.FindControl("btnFooterOthers");
            //    btnFooterAdd.Attributes.Add("onclick", "return ShowValidatemsgImmuOthers('" + txtFooterRadVaccineName.ClientID + "','" + dtFooterOtherDate.ClientID + "','" + btnOthers.ClientID+ "');");

            //}

            // Edit control

            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                if (e.Item is GridEditFormInsertItem)
                {
                    // insert
                }
                else
                {
                    // Edit
                    // Please add below code in your page
                    GridEditableItem          item                  = e.Item as GridEditableItem;
                    Telerik.Web.UI.RadButton  btnRemove             = (Telerik.Web.UI.RadButton)item.FindControl("btnRemove");
                    Telerik.Web.UI.RadTextBox txtEditRadVaccineName = (Telerik.Web.UI.RadTextBox)item.FindControl("txtEditRadVaccineName");
                    btnRemove.Enabled             = false;
                    txtEditRadVaccineName.Enabled = false;
                    //item["Name"].Controls[0].Visible = false;
                }
            }
        }