public void FillCombo()
    {
        try
        {
            DS = Obj_UserMaster.GetCafe(out StrError);
            if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
            {
                //DDLCafe.DataSource = DS.Tables[0];
                //DDLCafe.DataTextField = "Cafeteria";
                //DDLCafe.DataValueField = "CafeteriaId";
                //DDLCafe.DataBind();
                //DDLCafe.SelectedIndex = 0;
                ChkSite.DataSource     = DS.Tables[1];
                ChkSite.DataValueField = "CafeteriaId";
                ChkSite.DataTextField  = "Cafeteria";
                ChkSite.DataBind();
                ViewState["IsCentral"] = DS.Tables[1];
            }
            else
            {
            }
            // Obj_UserMaster = null;
            //DS = null;
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
    protected void GrdReport_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        flag = 1;
        try
        {
            switch (e.CommandName)
            {
            case ("Select"):
            {
                if (Convert.ToInt32(e.CommandArgument) != 0)
                {
                    ViewState["EditID"] = Convert.ToInt32(e.CommandArgument);
                    DS = Obj_UserMaster.GetUserDetailsForEdit(Convert.ToInt32(e.CommandArgument), out StrError);
                    DataTable dt = new DataTable();
                    //  dt = (DataTable)ViewState["IsCentral"];
                    if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0)
                    {
                        TxtUserId.Text   = DS.Tables[0].Rows[0]["LoginName"].ToString();
                        TxtMailId.Text   = DS.Tables[0].Rows[0]["EmailId"].ToString();
                        TxtUserName.Text = DS.Tables[0].Rows[0]["UserName"].ToString();
                        TxtPasswrod.Attributes["value"]      = DS.Tables[0].Rows[0]["Password"].ToString();
                        TxtConfrmPasswrd.Attributes["value"] = DS.Tables[0].Rows[0]["Password"].ToString();

                        string str;
                        str = DS.Tables[0].Rows[0]["IsAdmin"].ToString();
                        if (str.Equals("True"))
                        {
                            RadioIsAdmin.Text = "T";
                        }
                        else
                        {
                            RadioIsAdmin.Text = "F";
                        }
                    }
                    if (DS.Tables[1].Rows.Count > 0)
                    {
                        GridUserRight.DataSource = DS.Tables[1];
                        GridUserRight.DataBind();
                    }
                    if (DS.Tables[2].Rows.Count > 0)
                    {
                        GridUser.DataSource = DS.Tables[2];
                        GridUser.DataBind();
                    }
                    if (DS.Tables[3].Rows.Count > 0)
                    {
                        ChkSite.DataSource     = DS.Tables[3];
                        ChkSite.DataValueField = "CafeteriaId";
                        ChkSite.DataTextField  = "Cafeteria";
                        ChkSite.DataBind();
                        ViewState["IsCentral"] = DS.Tables[3];

                        for (int i = 0; i < ChkSite.Items.Count; i++)
                        {
                            if (Convert.ToBoolean(DS.Tables[3].Rows[i]["Cheked"]) == false)
                            {
                                ChkSite.Items[i].Selected = false;
                            }
                            else
                            {
                                ChkSite.Items[i].Selected = true;
                            }
                        }
                    }
                    else
                    {
                        FillGrid();
                        //MakeEmptyForm();
                    }
                    if (DS.Tables[4].Rows.Count > 0)
                    {
                        for (int k = 0; k < DS.Tables[4].Rows.Count; k++)
                        {
                            if (DS.Tables[4].Rows[k]["Form"].ToString() == "Edit Authorised Purchase Order")
                            {
                                CHKYESEDITPO.Checked = true;
                                TXTPASSEDITPO.Text   = DS.Tables[4].Rows[k]["Password"].ToString();
                            }
                            if (DS.Tables[4].Rows[k]["Form"].ToString() == "Unit Conversion In Item Master")
                            {
                                CHKYESUNITCONVERSION.Checked = true;
                            }
                            if (DS.Tables[4].Rows[k]["Form"].ToString() == "Purchase Order Shortage/Excess Report")
                            {
                                CHKESCESSREPORT.Checked = true;
                                TXTEXCESSREPORT.Text    = DS.Tables[4].Rows[k]["Password"].ToString();
                            }
                        }
                    }
                    else
                    {
                        CHKESCESSREPORT.Checked = CHKYESUNITCONVERSION.Checked = CHKYESEDITPO.Checked = false;
                        TXTEXCESSREPORT.Text    = TXTPASSEDITPO.Text = "";
                    }
                    DS              = null;
                    Obj_UserMaster  = null;
                    BtnSave.Visible = false;
                    if (!FlagEdit)
                    {
                        BtnUpdate.Visible = true;
                    }
                    if (!FlagDel)
                    {
                        BtnDelete.Visible = true;
                    }
                    TxtUserName.Focus();
                }
            }
            break;
            }
        }

        catch (Exception ex)
        {
            StrError = ex.Message;
        }
    }