internal DataSet BindAll(BudgetSubSectionModel ObjBudgetSubSectionModel)
 {
     try
     {
         ClsCon.cmd             = new SqlCommand();
         ClsCon.cmd.CommandType = CommandType.StoredProcedure;
         ClsCon.cmd.CommandText = "SPBudgetSubSection";
         ClsCon.cmd.Parameters.AddWithValue("@Ind", ObjBudgetSubSectionModel.Ind);
         ClsCon.cmd.Parameters.AddWithValue("@OrgID", ObjBudgetSubSectionModel.OrgID);
         ClsCon.cmd.Parameters.AddWithValue("@BrID", ObjBudgetSubSectionModel.BrID);
         con = ClsCon.SqlConn();
         ClsCon.cmd.Connection = con;
         dsBudgetSection       = new DataSet();
         ClsCon.da             = new SqlDataAdapter(ClsCon.cmd);
         ClsCon.da.Fill(dsBudgetSection);
         dsBudgetSection.DataSetName = "success";
     }
     catch (Exception)
     {
         dsBudgetSection             = new DataSet();
         dsBudgetSection.DataSetName = "error";
         return(dsBudgetSection);
     }
     finally
     {
         con.Close();
         con.Dispose();
         ClsCon.da.Dispose();
         ClsCon.cmd.Dispose();
     }
     return(dsBudgetSection);
 }
        internal DataTable SaveBudgetSubSection(BudgetSubSectionModel ObjBudgetSubSectionModel)
        {
            try
            {
                ClsCon.cmd             = new SqlCommand();
                ClsCon.cmd.CommandType = CommandType.StoredProcedure;
                ClsCon.cmd.CommandText = "SPBudgetSubSection";
                ClsCon.cmd.Parameters.AddWithValue("@Ind", ObjBudgetSubSectionModel.Ind);
                ClsCon.cmd.Parameters.AddWithValue("@OrgID", ObjBudgetSubSectionModel.OrgID);
                ClsCon.cmd.Parameters.AddWithValue("@BrID", ObjBudgetSubSectionModel.BrID);
                ClsCon.cmd.Parameters.AddWithValue("@UserID", ObjBudgetSubSectionModel.User);
                ClsCon.cmd.Parameters.AddWithValue("@IPAddress", ObjBudgetSubSectionModel.IP);
                ClsCon.cmd.Parameters.AddWithValue("@SectionName", ObjBudgetSubSectionModel.SubSectionName);
                ClsCon.cmd.Parameters.AddWithValue("@SectionNameHindi", ObjBudgetSubSectionModel.SubSectionNameHindi);
                ClsCon.cmd.Parameters.AddWithValue("@ParentSectionID", ObjBudgetSubSectionModel.ParentSectionID);
                ClsCon.cmd.Parameters.AddWithValue("@SchemeCode", ObjBudgetSubSectionModel.SchemeCode);


                con = ClsCon.SqlConn();
                ClsCon.cmd.Connection = con;
                dtBudgetSection       = new DataTable();
                ClsCon.da             = new SqlDataAdapter(ClsCon.cmd);
                ClsCon.da.Fill(dtBudgetSection);
                dtBudgetSection.TableName = "success";
            }
            catch (Exception)
            {
                dtBudgetSection           = new DataTable();
                dtBudgetSection.TableName = "error";
                return(dtBudgetSection);
            }
            finally
            {
                con.Close();
                con.Dispose();
                ClsCon.da.Dispose();
                ClsCon.cmd.Dispose();
            }
            return(dtBudgetSection);
        }
Beispiel #3
0
    private void BindAll()
    {
        try
        {
            objSubBudgetSection       = new BudgetSubSectionModel();
            objSubBudgetSection.Ind   = 11;
            objSubBudgetSection.OrgID = GlobalSession.OrgID;
            objSubBudgetSection.BrID  = GlobalSession.BrID;
            string  uri          = string.Format("BudgetSubSection/BindAll");
            DataSet dsSubSection = CommonCls.ApiPostDataSet(uri, objSubBudgetSection);
            if (dsSubSection.Tables.Count > 0)
            {
                if (dsSubSection.Tables[1].Rows.Count > 0)
                {
                    grdSubSection.DataSource = dsSubSection.Tables[1];
                    grdSubSection.DataBind();
                    //pnlSectionGrid.Visible = true;
                    VSSubSection = dsSubSection.Tables[1];

                    lstSubSeaction.DataSource     = dsSubSection.Tables[1];
                    lstSubSeaction.DataTextField  = "SectionName";
                    lstSubSeaction.DataValueField = "SectionName";
                    lstSubSeaction.DataBind();
                }
                if (dsSubSection.Tables[0].Rows.Count > 0)
                {
                    ddlSection.DataSource     = dsSubSection.Tables[0];
                    ddlSection.DataTextField  = "SectionName";
                    ddlSection.DataValueField = "SectionID";
                    ddlSection.DataBind();
                    ddlSection.Items.Insert(0, new ListItem("-- Select --", "0"));
                    VSSection = dsSubSection.Tables[0];
                }
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }
Beispiel #4
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (ddlSection.SelectedValue == "0")
            {
                ShowMessage("Select Group Name.", false);
                ddlSection.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtSubSectionName.Text))
            {
                ShowMessage("Enter Cost Centre Name.", false);
                txtSubSectionName.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtSubSectionNameHindi.Text))
            {
                ShowMessage("Enter Cost Centre Name(Hindi).", false);
                txtSubSectionNameHindi.Focus();
                return;
            }

            objSubBudgetSection                     = new BudgetSubSectionModel();
            objSubBudgetSection.OrgID               = GlobalSession.OrgID;
            objSubBudgetSection.BrID                = GlobalSession.BrID;
            objSubBudgetSection.User                = GlobalSession.UserID;
            objSubBudgetSection.IP                  = GlobalSession.IP;
            objSubBudgetSection.SubSectionName      = (txtSubSectionName.Text).ToUpper().Trim();
            objSubBudgetSection.SubSectionNameHindi = (txtSubSectionNameHindi.Text).Trim();
            objSubBudgetSection.ParentSectionID     = CommonCls.ConvertIntZero(ddlSection.SelectedValue);
            objSubBudgetSection.SchemeCode          = (txtSchemeCode.Text).Trim();

            string uri;
            if (hfSectionID.Value == "0")
            {
                if (VSSubSection != null)
                {
                    bool IsValid = CheckSectionNameExisting();
                    if (!IsValid)
                    {
                        return;
                    }
                }
                objSubBudgetSection.Ind = 1;//For Saving Data
                uri = string.Format("BudgetSubSection/SaveBudgetSubSection");
            }
            else
            {
                objSubBudgetSection.Ind       = 2;//For Update Data
                objSubBudgetSection.SectionID = CommonCls.ConvertIntZero(hfSectionID.Value);
                uri = string.Format("BudgetSubSection/UpdateBudgetSubSection");
            }

            DataTable dtSubSection = CommonCls.ApiPostDataTable(uri, objSubBudgetSection);
            if (dtSubSection.Rows.Count > 0)
            {
                ShowMessage("Record Save successfully.", true);
                hfSectionID.Value = "0";
                BindAll();
                ClearAll();
                ddlSection_SelectedIndexChanged(sender, e);
            }
            else
            {
                ShowMessage("Record not Save successfully.", false);
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }
Beispiel #5
0
        public DataTable DeleteBudgetSubSection(BudgetSubSectionModel ObjBudgetSubSectionModel)
        {
            DataTable SectionList = ObjBudgetSubSectionDA.DeleteBudgetSubSection(ObjBudgetSubSectionModel);

            return(SectionList);
        }
Beispiel #6
0
        public DataSet BindAll(BudgetSubSectionModel ObjBudgetSubSectionModel)
        {
            DataSet SectionList = ObjBudgetSubSectionDA.BindAll(ObjBudgetSubSectionModel);

            return(SectionList);
        }