Beispiel #1
0
    private void FillVoucherType()
    {
        try
        {
            objNarrMastermodel = new NarrationMasterModel()
            {
                Ind   = 22,
                OrgID = GlobalSession.OrgID,
                BrID  = GlobalSession.BrID,
                // YrCD = GlobalSession.YrCD,
                //VchType = Convert.ToInt32(Session["VchType"]),
            };

            string    uri = string.Format("NarrationMaster/FillVoucher");
            DataTable WarehouseVoucherlist = CommonCls.ApiPostDataTable(uri, objNarrMastermodel);
            if (WarehouseVoucherlist.Rows.Count > 0)
            {
                ddlFillVoucher.DataSource     = WarehouseVoucherlist;
                ddlFillVoucher.DataTextField  = "DocTypeDesc";
                ddlFillVoucher.DataValueField = "DocTypeID";
                ddlFillVoucher.DataBind();
                ddlFillVoucher.Items.Insert(0, new ListItem("-- Select --", "0"));
            }
        }
        catch (Exception ex)
        {
            // ShowMessage(ex.Message, false);
        }
    }
Beispiel #2
0
        public DataTable SaveProcess(NarrationMasterModel ObjNrrationMastModel)
        {
            objNarrMasterDA = new NarrationMasterDataAccess();

            DataTable SaveList = objNarrMasterDA.SaveNarration(ObjNrrationMastModel);

            return(SaveList);
        }
Beispiel #3
0
        public DataTable FillVoucher(NarrationMasterModel ObjNrrationMastModel)
        {
            objNarrMasterDA = new NarrationMasterDataAccess();

            DataTable fillVoucherType = objNarrMasterDA.LoadVoucherType(ObjNrrationMastModel);

            return(fillVoucherType);
        }
Beispiel #4
0
        public DataTable FillGrid(NarrationMasterModel ObjNrrationMastModel)

        {
            objNarrMasterDA = new NarrationMasterDataAccess();

            DataTable fillGrid = objNarrMasterDA.FillGridView(ObjNrrationMastModel);

            return(fillGrid);
        }
Beispiel #5
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            lblMsg.Text = lblMsg.CssClass = "";

            if (!CommonCls.CheckGUIDIsValid())
            {
                return;
            }

            if (ddlFillVoucher.SelectedValue == "0")
            {
                ddlFillVoucher.Focus();
                ShowMessage("Select Voucher Type..!", false);
                return;
            }
            if (string.IsNullOrEmpty(txtSnarration.Text.Trim()))
            {
                txtSnarration.Focus();
                ShowMessage("Enter Narration..!", false);
                return;
            }
            objNarrMastermodel = new NarrationMasterModel()
            {
                Ind   = 2,
                OrgID = GlobalSession.OrgID,
                BrID  = GlobalSession.BrID,
                YrCD  = GlobalSession.YrCD,
                User  = GlobalSession.UserID,
                IP    = GlobalSession.IP,
            };

            objNarrMastermodel.DocTypeID = Convert.ToInt32(ddlFillVoucher.SelectedItem.Value);

            objNarrMastermodel.NarrDesc = txtSnarration.Text;
            string    uri = string.Format("NarrationMaster/SaveProcess");
            DataTable WarehouSaveProcess = CommonCls.ApiPostDataTable(uri, objNarrMastermodel);
            if (WarehouSaveProcess.Rows.Count > 0)
            {
                ShowMessage("Data Is SucessFully Saved..!", true);
            }
            else
            {
                ShowMessage("Data Is Not Saved SucessFully..!", false);
            }
            FillGrid();
            clear();
        }
        catch (Exception ex)
        {
            // ShowMessage(ex.Message, false);
        }
    }
        internal DataTable SaveNarration(NarrationMasterModel ObjNrrationMastModel)
        {
            try
            {
                ClsCon.cmd             = new SqlCommand();
                ClsCon.cmd.CommandType = CommandType.StoredProcedure;
                ClsCon.cmd.CommandText = "SPNarration";

                ClsCon.cmd.CommandType = CommandType.StoredProcedure;
                ClsCon.cmd.Parameters.AddWithValue("@Ind", ObjNrrationMastModel.Ind);
                ClsCon.cmd.Parameters.AddWithValue("@OrgID", ObjNrrationMastModel.OrgID);
                // ClsCon.cmd.Parameters.AddWithValue("@BrID", ObjNrrationMastModel.BrID);
                // ClsCon.cmd.Parameters.AddWithValue("@YrCD", ObjNrrationMastModel.YrCD);
                ClsCon.cmd.Parameters.AddWithValue("@VchType", ObjNrrationMastModel.DocTypeID);
                ClsCon.cmd.Parameters.AddWithValue("@NarrDesc", ObjNrrationMastModel.NarrDesc);
                ClsCon.cmd.Parameters.AddWithValue("@IP", ObjNrrationMastModel.IP);
                ClsCon.cmd.Parameters.AddWithValue("@User", ObjNrrationMastModel.User);

                // ClsCon.cmd.Parameters.AddWithValue("@VchType", ObjWarehouseModel.VchType);

                con = ClsCon.SqlConn();
                ClsCon.cmd.Connection = con;
                dtSaveNarration       = new DataTable();
                ClsCon.da             = new SqlDataAdapter(ClsCon.cmd);
                ClsCon.da.Fill(dtSaveNarration);
                dtSaveNarration.TableName = "success";
            }
            catch (Exception)
            {
                dtSaveNarration           = new DataTable();
                dtSaveNarration.TableName = "error";
                return(dtSaveNarration);
            }
            finally
            {
                con.Close();
                con.Dispose();
                ClsCon.da.Dispose();
                ClsCon.cmd.Dispose();
            }
            return(dtSaveNarration);
        }
Beispiel #7
0
    private void FillGrid()
    {
        objNarrMastermodel = new NarrationMasterModel()
        {
            Ind       = 1,
            OrgID     = GlobalSession.OrgID,
            BrID      = GlobalSession.BrID,
            YrCD      = GlobalSession.YrCD,
            DocTypeID = Convert.ToInt32(ddlFillVoucher.SelectedValue),
        };

        string    uri = string.Format("NarrationMaster/FillGrid");
        DataTable WarehouseFillGridlist = CommonCls.ApiPostDataTable(uri, objNarrMastermodel);

        if (WarehouseFillGridlist.Rows.Count > 0)
        {
            grdNarration.DataSource = WarehouseFillGridlist;
            grdNarration.DataBind();
        }
    }
        internal DataTable LoadVoucherType(NarrationMasterModel ObjNrrationMastModel)
        {
            try
            {
                ClsCon.cmd             = new SqlCommand();
                ClsCon.cmd.CommandType = CommandType.StoredProcedure;
                ClsCon.cmd.CommandText = "SPMasters";

                ClsCon.cmd.CommandType = CommandType.StoredProcedure;
                ClsCon.cmd.Parameters.AddWithValue("@DataInd", ObjNrrationMastModel.Ind);
                ClsCon.cmd.Parameters.AddWithValue("@OrgID", ObjNrrationMastModel.OrgID);
                ClsCon.cmd.Parameters.AddWithValue("@BrID", ObjNrrationMastModel.BrID);
                ClsCon.cmd.Parameters.AddWithValue("@YrCD", ObjNrrationMastModel.YrCD);
                // ClsCon.cmd.Parameters.AddWithValue("@VchType", ObjWarehouseModel.VchType);

                con = ClsCon.SqlConn();
                ClsCon.cmd.Connection  = con;
                dtNarrationVoucherType = new DataTable();
                ClsCon.da = new SqlDataAdapter(ClsCon.cmd);
                ClsCon.da.Fill(dtNarrationVoucherType);
                dtNarrationVoucherType.TableName = "success";
            }
            catch (Exception)
            {
                dtNarrationVoucherType           = new DataTable();
                dtNarrationVoucherType.TableName = "error";
                return(dtNarrationVoucherType);
            }
            finally
            {
                con.Close();
                con.Dispose();
                ClsCon.da.Dispose();
                ClsCon.cmd.Dispose();
            }
            return(dtNarrationVoucherType);
        }