示例#1
0
 public static void SetPoint(string areacode, string pointcode)
 {
     using (var conn = SqlBase.Create())
     {
         var sql = $"insert into tb_area_point values ('{areacode}','{pointcode}')";
         conn.Execute(sql);
         conn.Close();
     }
 }
示例#2
0
 public static void AddContainer(Container container)
 {
     using (var conn = SqlBase.Create())
     {
         var sql = $"insert into tb_container values ('{container.containercode}','{container.materielcode}',{container.capacity})";
         conn.Execute(sql);
         conn.Close();
     }
 }
示例#3
0
 public static void AddMateriel(Materiel materiel)
 {
     using (var conn = SqlBase.Create())
     {
         var sql = $"insert into tb_materiel values ('{materiel.materielcode}','{materiel.materielname}')";
         conn.Execute(sql);
         conn.Close();
     }
 }
示例#4
0
 public static void RemovePoint(string areacode, string pointcode)
 {
     using (var conn = SqlBase.Create())
     {
         var sql = $"delete from tb_area_point where AreaCode='{areacode}' and PointCode='{pointcode}'";
         conn.Execute(sql);
         conn.Close();
     }
 }
示例#5
0
 public static void AddProperty(Materiel_Property property)
 {
     using (var conn = SqlBase.Create())
     {
         var sql = $"insert into tb_materiel_property values ('{property.materielcode}','{property.propertyname}','{property.propertyvalue}')";
         conn.Execute(sql);
         conn.Close();
     }
 }
示例#6
0
 public static void SetContainer(string pointcode, string containercode)
 {
     using (var conn = SqlBase.Create())
     {
         var sql = $"insert into tb_point_container values ('{pointcode}','{containercode}')";
         conn.Execute(sql);
         conn.Close();
     }
 }
示例#7
0
 public static void RemoveMateriel(string areacode, string materielcode)
 {
     using (var conn = SqlBase.Create())
     {
         var sql = $"delete from tb_area_materiel where AreaCode='{areacode}' and MaterielCode='{materielcode}'";
         conn.Execute(sql);
         conn.Close();
     }
 }
示例#8
0
 public static void AddPoint(Point point)
 {
     using (var conn = SqlBase.Create())
     {
         var sql = $"insert into tb_point values ('{point.pointcode}','{point.warecode}','{point.pointstate}')";
         conn.Execute(sql);
         conn.Close();
     }
 }
示例#9
0
 public static void AddWare(Ware ware)
 {
     using (var conn = SqlBase.Create())
     {
         var sql = $"insert into tb_ware values ('{ware.warecode}','{ware.warename}', '{ware.enable}', {ware.rowcount}, {ware.columncount},{ware.layercount})";
         conn.Execute(sql);
         conn.Close();
     }
 }
示例#10
0
 public static void RemoveProperty(string materielcode, string propertyname)
 {
     using (var conn = SqlBase.Create())
     {
         var sql = $"delete from tb_materiel_property where MaterielCode='{materielcode}' and PropertyName='{propertyname}'";
         conn.Execute(sql);
         conn.Close();
     }
 }
示例#11
0
 public static void SetMateriel(string areacode, string materielcode)
 {
     using (var conn = SqlBase.Create())
     {
         var sql = $"insert into tb_area_materiel values ('{areacode}','{materielcode}')";
         conn.Execute(sql);
         conn.Close();
     }
 }
示例#12
0
 public static void RemoveContainer(string pointcode, string containercode)
 {
     using (var conn = SqlBase.Create())
     {
         var sql = $"delete from tb_point_container where PointCode='{pointcode}' and ContainerCode='{containercode}'";
         conn.Execute(sql);
         conn.Close();
     }
 }
示例#13
0
 public static void AddArea(Area area)
 {
     using (var conn = SqlBase.Create())
     {
         var sql = $"insert into tb_area values ('{area.areacode}','{area.areaname}','{area.warecode}')";
         conn.Execute(sql);
         conn.Close();
     }
 }
示例#14
0
 public static List <Point> SelectPointByWare(string warecode)
 {
     using (var conn = SqlBase.Create())
     {
         var sql    = $"select * from tb_point where WareCode='{warecode}'";
         var points = conn.Query <Point>(sql);
         conn.Close();
         return(points?.ToList());
     }
 }
示例#15
0
 public static List <Materiel> SelectMateriel()
 {
     using (var conn = SqlBase.Create())
     {
         var sql  = $"select * from tb_materiel";
         var list = conn.Query <Materiel>(sql);
         conn.Close();
         return(list?.ToList());
     }
 }
示例#16
0
 public static List <AreaMateriel> SelectMaterielByArea(string areacode)
 {
     using (var conn = SqlBase.Create())
     {
         var sql  = $"select * from tb_area_materiel where AreaCode='{areacode}'";
         var list = conn.Query <AreaMateriel>(sql);
         conn.Close();
         return(list?.ToList());
     }
 }
示例#17
0
 public static List <Area> SelectArea(string warecode)
 {
     using (var conn = SqlBase.Create())
     {
         var sql  = "select * from tb_area";
         var list = conn.Query <Area>(sql);
         conn.Close();
         return(list?.ToList());
     }
 }
示例#18
0
 public static List <Materiel_Property> SelectProperty(string materielcode)
 {
     using (var conn = SqlBase.Create())
     {
         var sql  = $"select * from tb_materiel_property where MaterielCode='{materielcode}'";
         var list = conn.Query <Materiel_Property>(sql);
         conn.Close();
         return(list?.ToList());
     }
 }
示例#19
0
 public static List <Ware> SelectWare()
 {
     using (var conn = SqlBase.Create())
     {
         var sql  = $"select * from tb_ware";
         var list = conn.Query <Ware>(sql);
         conn.Close();
         return(list?.ToList());
     }
 }
示例#20
0
 public static List <Container> SelectContainer(string pointcode)
 {
     using (var conn = SqlBase.Create())
     {
         var sql  = $"select tb_container.ContainerCode,MaterielCode,Capacity from tb_container,tb_point_container where tb_container.ContainerCode=tb_point_container.ContainerCode and PointCode='{pointcode}'";
         var list = conn.Query <Container>(sql);
         conn.Close();
         return(list?.AsList());
     }
 }
示例#21
0
 public static List <Container> SelectContainerByWare(string wareCode)
 {
     using (var conn = SqlBase.Create())
     {
         var sql  = $"select * from tb_container where substring(ContainerCode,1, 14)='{wareCode}'";
         var list = conn.Query <Container>(sql);
         conn.Close();
         return(list?.AsList());
     }
 }
示例#22
0
 public static List <Point> SelectPointByArea(string warecode, string areacode)
 {
     using (var conn = SqlBase.Create())
     {
         var sql = $"select * from( select tb_point.PointCode,AreaCode,WareCode,PointState from tb_point left join tb_area_point on tb_point.PointCode=tb_area_point.PointCode )t where AreaCode='{areacode}' and WareCode='{warecode}'";
         if (string.IsNullOrEmpty(areacode))
         {
             sql = $"select * from( select tb_point.PointCode,AreaCode,WareCode,PointState from tb_point left join tb_area_point on tb_point.PointCode=tb_area_point.PointCode )t where (AreaCode is null or AreaCode='') and WareCode='{warecode}'";
         }
         var points = conn.Query <Point>(sql);
         conn.Close();
         return(points?.ToList());
     }
 }