예제 #1
0
        public void Save(PartsListEtity partsData)
        {
            StringBuilder query      = new StringBuilder();
            var           parameters = new List <SqlParameter>();

            query.AppendLine("insert into [PartsList]");
            query.AppendLine("(");
            query.AppendLine("[部品番号]");
            query.AppendLine(",[部品名称]");
            query.AppendLine(",[数量]");
            query.AppendLine(",[SQKID]");
            query.AppendLine(")");
            query.AppendLine("values");
            query.AppendLine("(");
            query.AppendLine("@部品番号");
            query.AppendLine(",@部品名称");
            query.AppendLine(",@数量");
            query.AppendLine(",@SQKID");
            query.AppendLine(")");

            parameters.Clear();
            parameters.Add(new SqlParameter("@部品番号", partsData.PartsNumber));
            parameters.Add(new SqlParameter("@部品名称", partsData.PartsName));
            parameters.Add(new SqlParameter("@数量", partsData.PartsQuantity));
            parameters.Add(new SqlParameter("@SQKID", partsData.SqkId));

            SqlServerHelper.Execute(query.ToString(), parameters.ToArray());
        }
예제 #2
0
        private void SaveButtonExecute()
        {
            var savePartsList = new PartsListEtity(0,
                                                   SelectedSqk.SqkId,
                                                   PartsNumberText,
                                                   PartsNameText,
                                                   Convert.ToInt32(PartsQuantityText));

            _partsListRipository.Save(savePartsList);
            PartsListUpDate();
            SqkIdText         = string.Empty;
            PartsNumberText   = string.Empty;
            PartsQuantityText = string.Empty;
        }
예제 #3
0
        public void Delete(PartsListEtity partsData)
        {
            StringBuilder query      = new StringBuilder();
            var           parameters = new List <SqlParameter>();

            query.AppendLine("delete");
            query.AppendLine("from");
            query.AppendLine("        [DDD2].[dbo].[PartsList]");
            query.AppendLine("where");
            query.AppendLine("        [ID]=@ID");

            parameters.Clear();
            parameters.Add(new SqlParameter("@ID", partsData.Id));
            SqlServerHelper.Execute(query.ToString(), parameters.ToArray());
        }
예제 #4
0
 public void Save(PartsListEtity partsData)
 {
     throw new NotImplementedException();
 }