public static tbl_MovePro GetByIDAndAgentIDSend(int ID, int AgentIDSend)
 {
     using (var dbe = new inventorymanagementEntities())
     {
         tbl_MovePro ai = dbe.tbl_MovePro.Where(a => a.ID == ID && a.AgentIDSend == AgentIDSend).SingleOrDefault();
         if (ai != null)
         {
             return(ai);
         }
         else
         {
             return(null);
         }
     }
 }
 public static string UpdateStatus(int ID, int Status, DateTime ModifiedDate, string ModifiedBy)
 {
     using (var dbe = new inventorymanagementEntities())
     {
         tbl_MovePro ui = dbe.tbl_MovePro.Where(a => a.ID == ID).SingleOrDefault();
         if (ui != null)
         {
             ui.Status       = Status;
             ui.ModifiedBy   = ModifiedBy;
             ui.ModifiedDate = ModifiedDate;
             int kq = dbe.SaveChanges();
             return(kq.ToString());
         }
         else
         {
             return(null);
         }
     }
 }
 public static string Insert(int AgentIDSend, string AgentNameSend, int AgentIDReceive, string AgentNameReceive, int Status, string Note, bool IsHidden,
                             DateTime CreatedDate, string CreatedBy)
 {
     using (var dbe = new inventorymanagementEntities())
     {
         tbl_MovePro ui = new tbl_MovePro();
         ui.AgentIDSend      = AgentIDSend;
         ui.AgentNameSend    = AgentNameSend;
         ui.AgentIDReceive   = AgentIDReceive;
         ui.AgentNameReceive = AgentNameReceive;
         ui.Status           = Status;
         ui.Note             = Note;
         ui.IsHidden         = IsHidden;
         ui.CreatedDate      = CreatedDate;
         ui.CreatedBy        = CreatedBy;
         dbe.tbl_MovePro.Add(ui);
         int kq = dbe.SaveChanges();
         return(kq.ToString());
     }
 }