Пример #1
0
        public ActionResult DisplayWGRNList()
        {
            FillItem();
            FillCurrency();
            WorkShopGRN WorkShopGRN = new WorkShopGRN();

            WorkShopGRN.WorkShopGRNItems = new List <WorkShopGRNItem>();
            var item = new WorkShopGRNItem();

            WorkShopGRN.WorkShopGRNItems.Add(item);
            return(PartialView("_DisplayWGRNList", WorkShopGRN));
        }
        public int InsertWGRNItem(WorkShopGRNItem model, IDbConnection connection, IDbTransaction trn)
        //public int InsertGRNItem(GRNItem model, IDbConnection connection, IDbTransaction trn)

        {
            try
            {
                string sql = @"insert  into WorkShopGRNItem
                            (WorkShopGRNId,SlNo,ItemId,ItemDescription,PartNo,Quantity,Unit,Rate,Discount,Amount,Remarks)
                            Values (@WorkShopGRNId,@SlNo,@ItemId,@ItemDescription,@PartNo,@Quantity,@Unit,@Rate,@Discount,@Amount,@Remarks);
                            SELECT CAST(SCOPE_IDENTITY() as int)";

                var id = connection.Query <int>(sql, model, trn).Single();
                return(id);
            }
            catch (Exception)
            {
                throw;
            }
        }