public static void fn物件更新(CProduct product) { string sql = $"EXEC 物件更新 "; sql += $"@{CProdcutKey.fProductId},"; sql += $"@{CProdcutKey.fProductName},"; sql += $"@{CProdcutKey.fProductPrice},"; sql += $"@{CProdcutKey.fProductAddress},"; sql += $"@{CProdcutKey.fProductExplain},"; sql += $"@{CProdcutKey.fProductPhoto}"; List <SqlParameter> paras = new List <SqlParameter>() { new SqlParameter(CProdcutKey.fProductId, product.fProductId), new SqlParameter(CProdcutKey.fProductName, product.fProductName), new SqlParameter(CProdcutKey.fProductPrice, product.fProductPrice), new SqlParameter(CProdcutKey.fProductAddress, product.fProductAddress), new SqlParameter(CProdcutKey.fProductExplain, product.fProductExplain), new SqlParameter(CProdcutKey.fProductPhoto, (object)product.fProductPhoto ?? DBNull.Value) //可null }; CDbManager.executeSql(sql, paras); }
public static void fn顧客更新(CCustomer customer) { string sql = $"EXEC 顧客更新 "; sql += $"@{CCustomerKey.fCustomerId},"; sql += $"@{CCustomerKey.fCustomerName},"; sql += $"@{CCustomerKey.fCustomerBirth},"; sql += $"@{CCustomerKey.fCustomerGender},"; sql += $"@{CCustomerKey.fCustomerEmail},"; sql += $"@{CCustomerKey.fCustomerAddress},"; sql += $"@{CCustomerKey.fCustomerPhone}"; List <SqlParameter> paras = new List <SqlParameter>() { new SqlParameter(CCustomerKey.fCustomerId, customer.fCustomerId), new SqlParameter(CCustomerKey.fCustomerName, customer.fCustomerName), new SqlParameter(CCustomerKey.fCustomerBirth, customer.fCustomerBirth), new SqlParameter(CCustomerKey.fCustomerGender, customer.fCustomerGender), new SqlParameter(CCustomerKey.fCustomerEmail, customer.fCustomerEmail), new SqlParameter(CCustomerKey.fCustomerAddress, customer.fCustomerAddress), new SqlParameter(CCustomerKey.fCustomerPhone, customer.fCustomerPhone) }; CDbManager.executeSql(sql, paras); }
public static void fn物件刪除(CProduct product) { string sql = $"EXEC 物件刪除 "; sql += $"@{CProdcutKey.fProductId}"; List <SqlParameter> paras = new List <SqlParameter>() { new SqlParameter(CProdcutKey.fProductId, product.fProductId) }; CDbManager.executeSql(sql, paras); }
public static void fn顧客刪除(CCustomer customer) { string sql = $"EXEC 顧客刪除 "; sql += $"@{CCustomerKey.fCustomerId}"; List <SqlParameter> paras = new List <SqlParameter>() { new SqlParameter(CCustomerKey.fCustomerId, customer.fCustomerId) }; CDbManager.executeSql(sql, paras); }
public static List <CProduct> fn物件查詢() { string sql = $"EXEC 物件查詢"; return((List <CProduct>)CDbManager.querySql(sql, null, reader物件查詢)); }
public static List <CCustomer> fn顧客查詢() { string sql = $"EXEC 顧客查詢"; return((List <CCustomer>)CDbManager.querySql(sql, null, reader顧客查詢)); }