Exemplo n.º 1
0
        public IHttpActionResult CreateProductGroupMaster(ProductGroupMaster productGroupMaster)
        {
            var isSave = _productGroupRepository.CreateProductGroup(productGroupMaster);

            if (isSave == true)
            {
                return(Ok(isSave));
            }
            return(BadRequest());
        }
Exemplo n.º 2
0
        public IHttpActionResult UpdateProductGroup(ProductGroupMaster productGroupMaster)
        {
            var isupdate = _productGroupRepository.UpdateProductGroup(productGroupMaster);

            if (isupdate == true)
            {
                return(Ok(isupdate));
            }
            return(BadRequest());
        }
    public ActionResult Details(int?id)
    {
        if (id == null)
        {
            return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
        }
        ProductGroupMaster getMaster = _uow.ProductGroupMasterRepository.GetByID(id);

        if (getMaster == null)
        {
            return(HttpNotFound());
        }
        return(View(getMaster));
    }
Exemplo n.º 4
0
        public bool UpdateProductGroup(ProductGroupMaster productGroupMaster)
        {
            DateTime now = DateTime.Now;

            productGroupMaster.ModifiedDate = now;
            int rowsAffected = this._db.Execute("UPDATE ProductGroupMaster SET Name = @Name ,Description = @Description,ModifiedBy=1, ModifiedDate = @ModifiedDate WHERE Id = " +
                                                productGroupMaster.Id, productGroupMaster);

            if (rowsAffected > 0)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 5
0
        public bool CreateProductGroup(ProductGroupMaster productGroupMaster)
        {
            DateTime now = DateTime.Now;

            productGroupMaster.CreatedDate  = now;
            productGroupMaster.ModifiedDate = now;

            int rowsAffected = this._db.Execute(@"INSERT ProductGroupMaster(Name,Description,IsActive,CreatedBy,CreatedDate,ModifiedBy,ModifiedDate) values (@Name,@Description,1,1,@CreatedDate,1,@ModifiedDate)",

                                                new { Name = productGroupMaster.Name, Description = productGroupMaster.Description, IsActive = 1, CreatedBy = 1, CreatedDate = productGroupMaster.CreatedDate, ModifiedBy = 1, ModifiedDate = productGroupMaster.ModifiedDate });

            if (rowsAffected > 0)
            {
                return(true);
            }
            return(false);
        }
    public string Delete(int id)
    {
        string msg = "";

        try
        {
            ProductGroupMaster objMaster = _uow.ProductGroupMasterRepository.GetByID(id);
            _uow.ProductGroupMasterRepository.Delete(id);
            _uow.Save();
            msg = "Deleted Successfully";
        }
        catch (Exception ex)
        {
            msg = "Error While Processing the Request " + ex.Message;
        }
        return(msg);
    }
    public string Edit([Bind(Include = "ID,ProductGroupName,PurchaseRate,UnitMasterID,IsActive,IntroductionDate")] ProductGroupMaster objMaster)
    {
        string msg = "";

        try
        {
            if (ModelState.IsValid)
            {
                _uow.ProductGroupMasterRepository.Update(objMaster);
                _uow.Save();
                msg = "Updated Successully";
            }
            else
            {
                msg = "Update Validation Error";
            }
        }
        catch (Exception ex)
        {
            msg = "Error while Processing the Request " + ex.Message;
        }
        return(msg);
    }
Exemplo n.º 8
0
 protected void Page_UnLoad(object sender, EventArgs e)
 {
     objCommonClass        = null;
     objProductGroupMaster = null;
 }