public static void EditAdjust(int avnumber, string itemcode, string status)
 {
     using (Model1 entities = new Model1())
     {
         //AdjustmentVoucherDetail adjustdetail = entities.AdjustmentVoucherDetails.Where(p => p.AVnumber == avnumber && p.ItemCode==itemcode).First<AdjustmentVoucherDetail>();
         AdjustmentVoucherDetail adjustdetail = entities.AdjustmentVoucherDetails.Where(p => p.AVnumber == avnumber && p.ItemCode == itemcode).First <AdjustmentVoucherDetail>();
         adjustdetail.Status = status;
         entities.SaveChanges();
     }
 }
 public static void AddAdjustmentVoucherDetails(int AVnumber, string ItemCode, string Description, int Qty, double Price, string Reason)
 {
     using (Model1 entities = new Model1())
     {
         AdjustmentVoucherDetail AdjustmentVoucherDetail = new AdjustmentVoucherDetail
         {
             AVnumber    = AVnumber,
             ItemCode    = ItemCode,
             Description = Description,
             Qty         = Qty,
             Price       = Price,
             Reason      = Reason
         };
         entities.AdjustmentVoucherDetails.Add(AdjustmentVoucherDetail);
         entities.SaveChanges();
     }
 }