Tuesday, February 2, 2010

Save Multiple check box value


 /// update rights of Coverage area(Refer functionality save multiple checkbox functionality)
    /// 
    /// 

    /// 

    protected void btnCopy_Click(object sender, EventArgs e)
    {
        TerminalCatalogConfig objTerminalCatalogConfig = new TerminalCatalogConfig();
        Hashtable htbParam = new Hashtable();
        DataSet dsChk = new DataSet();
        int LocationId;

        for (int iCtr = 0; iCtr < grdLocation.Items.Count; iCtr++)
        {
            CheckBox mychkLocations = (CheckBox)grdLocation.Items[iCtr].FindControl("chkLocations");
            if (mychkLocations.Checked == true)
            {
                htbParam.Clear();
                LocationId = (int)grdLocation.Items[iCtr].OwnerTableView.DataKeyValues[iCtr]["KioskID"];
                htbParam.Add(TerminalCatalogConfig.KEY_FROMKIOSKID, (Convert.ToInt32(Session["TerminalId"])));
                htbParam.Add(TerminalCatalogConfig.KEY_TOKIOSKID, LocationId);
                htbParam.Add(TerminalCatalogConfig.KEY_UPDATETYPE, RadioButtonListCopyAction.SelectedItem.Value.ToString());

                Response objResponse = objTerminalCatalogConfig.CopyCatalogConfigForLocation(htbParam);

                if (objResponse.Status == Enums.ResponseStatus.error)
                {
                    lblMessage.CssClass = "lblMessage";
                    lblMessage.Text = GetResourceValue(Message.GetDBErrorMessage(objResponse.ResponseCode));
                }
                else
                {
                    lblMessage.Text = TioPortalUtilities.Message.messagePrompt("Locations", 2, 0);
                    lblMessage.CssClass = "lblMessageSuccess";
                }
            }
        }
    }

No comments:

Post a Comment