public string fnInsert(ProductM productM) { string sSql = " INSERT INTO [dbo].[MNDTproduct_master] " + " ([product_id] " + " ,[company_id] " + " ,[name] " + " ,[unit] " + " ,[currency] " + " ,[cost] " + " ,[price] " + " ,[shelf_life] " + " ,[description] " + " ,[status] " + " ,[create_id] " + " ,[create_datetime]) " + " VALUES " + " ('" + productM.product_id + "' " + " ,'" + productM.company_id + "' " + " ,'" + productM.name + "' " + " ,'" + productM.unit + "' " + " ,'" + productM.currency + "' " + " ,'" + productM.cost + "' " + " ,'" + productM.price + "' " + " ,'" + productM.shelf_life + "' " + " ,'" + productM.description + "' " + " ,'N' " + " ,'" + productM.create_id + "' " + " ,GETDATE()) "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnInsert(ProgramD programD) { string sSql = " INSERT INTO [MNDTprogram_details] " + " ([program_id] " + " ,[group_id] " + " ,[read] " + " ,[write] " + " ,[execute] " + " ,[create_id] " + " ,[create_datetime] " + " ,[modify_id] " + " ,[modify_datetime]) " + " VALUES " + " ('" + programD.program_id + "' " + " ,'" + programD.group_id + "' " + " ,'" + programD.read + "' " + " ,'" + programD.write + "' " + " ,'" + programD.execute + "' " + " ,'" + programD.create_id + "' " + " ,GETDATE() " + " ,'" + programD.create_id + "' " + " ,GETDATE()) "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnInsert(ShopItem shopItem) { string sSql = " INSERT INTO [MNDTshop_item] " + " ([product_id] " + " ,[category] " + " ,[content] " + " ,[description] " + " ,[remarks] " + " ,[type] " + " ,[fold] " + " ,[create_id] " + " ,[create_datetime] " + " ,[modify_id] " + " ,[modify_datetime] " + " ,[status]) " + " VALUES " + " ('" + shopItem.product_id + "' " + " ,'" + shopItem.category + "' " + " ,'" + shopItem.content + "' " + " ,'" + shopItem.description + "' " + " ,'" + shopItem.remarks + "' " + " ,'" + shopItem.type + "' " + " ,'" + shopItem.fold + "' " + " ,'" + shopItem.create_id + "' " + " ,GETDATE() " + " ,'" + shopItem.create_id + "' " + " ,GETDATE() " + " ,'N') "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnInsert(Material material) { string sSql = " INSERT INTO [dbo].[MNDTmaterial] " + " ([material_id] " + " ,[company_id] " + " ,[name] " + " ,[unit] " + " ,[currency] " + " ,[price] " + " ,[shelf_life] " + " ,[description] " + " ,[status] " + " ,[create_id] " + " ,[create_datetime]) " + " VALUES " + " ('" + material.material_id + "' " + " ,'" + material.company_id + "' " + " ,'" + material.name + "' " + " ,'" + material.unit + "' " + " ,'" + material.currency + "' " + " ,'" + material.price + "' " + " ,'" + material.shelf_life + "' " + " ,'" + material.description + "' " + " ,'N' " + " ,'" + material.create_id + "' " + " ,GETDATE()) "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnInsert(SalesM salesM) { string sSql = " INSERT INTO [dbo].[MNDTsales_master] " + " ([order_id] " + " ,[id] " + " ,[pay] " + " ,[order_status] " + " ,[datetime] " + " ,[complete] " + " ,[description] " + " ,[create_id] " + " ,[create_datetime]) " + " VALUES " + " ('" + salesM.order_id + "' " + " ,'" + salesM.id + "' " + " ,'" + salesM.pay + "' " + " ,'" + salesM.order_status + "' " + " ,'" + salesM.datetime + "' " + " ,'N' " + " ,'" + salesM.description + "' " + " ,'" + salesM.create_id + "' " + " ,GETDATE()) "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnInsert(SReturnD sreturnD) { string sSql = " INSERT INTO [MNDTSreturn_details] " + " ([seq] " + " ,[return_id] " + " ,[product_id] " + " ,[warehouse_id] " + " ,[amount] " + " ,[price] " + " ,[description] " + " ,[create_id] " + " ,[create_datetime] " + " ,[modify_id] " + " ,[modify_datetime]) " + " VALUES " + " ('" + sreturnD.seq + "' " + " ,'" + sreturnD.return_id + "' " + " ,'" + sreturnD.product_id + "' " + " ,'" + sreturnD.warehouse_id + "' " + " ,'" + sreturnD.amount + "' " + " ,'" + sreturnD.price + "' " + " ,'" + sreturnD.description + "' " + " ,'" + sreturnD.create_id + "' " + " ,GETDATE() " + " ,'" + sreturnD.create_id + "' " + " ,GETDATE()) "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnInsert(Company company) { string sSql = " INSERT INTO [dbo].[MNDTcompany] " + " ([company_id] " + " ,[tax_id] " + " ,[name] " + " ,[email] " + " ,[pay] " + " ,[address] " + " ,[tel] " + " ,[phone] " + " ,[description] " + " ,[status] " + " ,[create_id] " + " ,[create_datetime]) " + " VALUES " + " ('" + company.company_id + "' " + " ,'" + company.tax_id + "' " + " ,'" + company.name + "' " + " ,'" + company.email + "' " + " ,'" + company.pay + "' " + " ,'" + company.address + "' " + " ,'" + company.tel + "' " + " ,'" + company.phone + "' " + " ,'" + company.description + "' " + " ,'N' " + " ,'" + company.create_id + "' " + " ,GETDATE()) "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnInsert(ReceiveD receiveD) { string sSql = " INSERT INTO [MNDTreceive_details] " + " ([seq] " + " ,[order_id] " + " ,[material_id] " + " ,[warehouse_id] " + " ,[amount] " + " ,[price] " + " ,[complete] " + " ,[pay_complete] " + " ,[description] " + " ,[create_id] " + " ,[create_datetime] " + " ,[modify_id] " + " ,[modify_datetime]) " + " VALUES " + " ('" + receiveD.seq + "' " + " ,'" + receiveD.order_id + "' " + " ,'" + receiveD.material_id + "' " + " ,'" + receiveD.warehouse_id + "' " + " ,'" + receiveD.amount + "' " + " ,'" + receiveD.price + "' " + " ,'N' " + " ,'N' " + " ,'" + receiveD.description + "' " + " ,'" + receiveD.create_id + "' " + " ,GETDATE() " + " ,'" + receiveD.create_id + "' " + " ,GETDATE()) "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnInsert(Client client) { string sSql = " INSERT INTO [dbo].[MNDTclient] " + " ([client_id] " + " ,[password] " + " ,[name] " + " ,[email] " + " ,[address] " + " ,[tel] " + " ,[phone] " + " ,[description] " + " ,[status] " + " ,[create_id] " + " ,[create_datetime]) " + " VALUES " + " ('" + client.client_id + "' " + " ,'" + client.encrypt_password + "' " + " ,'" + client.name + "' " + " ,'" + client.email + "' " + " ,'" + client.address + "' " + " ,'" + client.tel + "' " + " ,'" + client.phone + "' " + " ,'" + client.description + "' " + " ,'N' " + " ,'" + client.create_id + "' " + " ,GETDATE()) "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnInsert(QuotesD quotesD) { string sSql = " INSERT INTO [MNDTquotes_details] " + " ([order_id] " + " ,[product_id] " + " ,[amount] " + " ,[price] " + " ,[modify_amount] " + " ,[modify_price] " + " ,[description] " + " ,[create_id] " + " ,[create_datetime] " + " ,[modify_id] " + " ,[modify_datetime]) " + " VALUES " + " ('" + quotesD.order_id + "' " + " ,'" + quotesD.product_id + "' " + " ,'" + quotesD.amount + "' " + " ,'" + quotesD.price + "' " + " ,'" + quotesD.amount + "' " + " ,'" + quotesD.price + "' " + " ,'" + quotesD.description + "' " + " ,'" + quotesD.create_id + "' " + " ,GETDATE() " + " ,'" + quotesD.create_id + "' " + " ,GETDATE()) "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public static string fnGetOrderNum(HttpContext context, string sType) { KindRepository kindRepository = new KindRepository(); KindD kindD = new KindD(); kindD.KindId("O01") .CodeId("DATE") .CreateId(context.Session["id"].ToString()); string sNowDate = DateTime.Now.ToString("yyyyMMdd"); string sCodeDate = kindRepository.fnSelect(kindD); if (sNowDate != sCodeDate) { fnSetZeroOrder(); } kindD.CodeId(sType); string sNowNum = kindRepository.fnSelect(kindD); string sSql = " UPDATE [MNDTkind_details] " + " SET [parameter] = '" + (int.Parse(sNowNum) + 1).ToString() + "' " + " WHERE [kind_id] = 'O01' " + " AND [code_id] = '" + sType + "' "; PublicApi.fnExecuteSQL(sSql, "MNDT"); return(sNowDate + fnFixOrder(sNowNum)); }
public string fnDeletes(ShopItem shopItem, string sIP, string sId) { string sSql = " UPDATE [dbo].[MNDTshop_item] " + " SET [status] = 'D' " + " WHERE [product_id] IN (" + shopItem.product_id + ")"; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnDelete(ProgramD programD) { string sSql = " DELETE [MNDTprogram_details] " + " WHERE [group_id] = '" + programD.group_id + "' " + " AND [program_id] = '" + programD.program_id + "' "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnDelete(QuotesD quotesD) { string sSql = " DELETE [MNDTquotes_details] " + " WHERE [order_id] = '" + quotesD.order_id + "' " + " AND [product_id] = '" + quotesD.product_id + "' "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnDelete(ProductD productD) { string sSql = " DELETE [dbo].[MNDTproduct_details] " + " WHERE [product_id] = '" + productD.product_id + "' " + " AND [material_id] = '" + productD.material_id + "' "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnDelete(SalesD salesD) { string sSql = " DELETE [MNDTsales_details] " + " WHERE [order_id] = '" + salesD.order_id + "' " + " AND [seq] = '" + salesD.seq + "' "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnDelete(SReturnD sreturnD) { string sSql = " DELETE [MNDTSreturn_details] " + " WHERE [return_id] = '" + sreturnD.return_id + "' " + " AND [seq] = '" + sreturnD.seq + "' "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnDelete(PurchaseD purchaseD) { string sSql = " DELETE [MNDTpurchase_details] " + " WHERE [order_id] = '" + purchaseD.order_id + "' " + " AND [material_id] = '" + purchaseD.material_id + "' "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnDelete(ReceiveD receiveD) { string sSql = " DELETE [MNDTreceive_details] " + " WHERE [order_id] = '" + receiveD.order_id + "' " + " AND [seq] = '" + receiveD.seq + "' "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnDelete(GroupD groupD) { string sSql = " DELETE [dbo].[MNDTgroup_details] " + " WHERE [group_id] = '" + groupD.group_id + "' " + " AND [id] = '" + groupD.id + "' "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnUpdate(KindM kindM) { string sSql = " UPDATE [dbo].[MNDTkind_master] " + " SET [name] = '" + kindM.name + "' " + " ,[description] = '" + kindM.description + "' " + " ,[modify_id] = '" + kindM.create_id + "' " + " ,[modify_datetime] = GETDATE() " + " WHERE [kind_id] = '" + kindM.kind_id + "' "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
//public string fnInsert(Carousel carousel) //{ // string sSql = " INSERT INTO [MNDTCarousel] " + // " ([carousel_id] " + // " ,[category] " + // " ,[content] " + // " ,[description] " + // " ,[remarks] " + // " ,[type] " + // " ,[fold] " + // " ,[create_id] " + // " ,[create_datetime] " + // " ,[modify_id] " + // " ,[modify_datetime] " + // " ,[status]) " + // " VALUES " + // " ('" + carousel.carousel_id + "' " + // " ,'" + carousel.category + "' " + // " ,'" + carousel.content + "' " + // " ,'" + carousel.description + "' " + // " ,'" + carousel.remarks + "' " + // " ,'" + carousel.type + "' " + // " ,'" + carousel.fold + "' " + // " ,'" + carousel.create_id + "' " + // " ,GETDATE() " + // " ,'" + carousel.create_id + "' " + // " ,GETDATE() " + // " ,'N') "; // return PublicApi.fnExecuteSQL(sSql, "MNDT"); //} public string fnUpdate(Carousel carousel, string sIP, string sId) { string sSql = " UPDATE [dbo].[MNDTCarousel] " + " SET [name] = '" + carousel.name + "' " + " ,[remarks] = '" + carousel.remarks + "' " + " ,[modify_id] = '" + carousel.create_id + "' " + " ,[modify_datetime] = GETDATE() " + " WHERE [carousel_id] = '" + carousel.carousel_id + "' "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnUpdate(ProductD productD) { string sSql = " UPDATE [dbo].[MNDTproduct_details] " + " SET [amount] = '" + productD.amount + "' " + " ,[modify_id] = '" + productD.create_id + "' " + " ,[modify_datetime] = GETDATE() " + " WHERE [product_id] = '" + productD.product_id + "' " + " AND [material_id] = '" + productD.material_id + "' "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnAudits(ReceiveD receiveD) { string sSql = " UPDATE [MNDTreceive_details] " + " SET [complete] = '" + receiveD.complete + "' " + " ,[modify_id] = '" + receiveD.create_id + "' " + " ,[modify_datetime] = GETDATE() " + " WHERE [order_id] = '" + receiveD.order_id + "' "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnChangeInsert(SalesM salesM) { string sSql = " INSERT INTO [dbo].[MNDTsales_master] " + " ([order_id] " + " ,[id] " + " ,[pay] " + " ,[order_status] " + " ,[datetime] " + " ,[complete] " + " ,[description] " + " ,[create_id] " + " ,[create_datetime]) " + " SELECT TOP 1 [order_id] " + " ,'" + salesM.create_id + "' " + " ,'' " + " ,'' " + " ,GETDATE() " + " ,'N' " + " ,'' " + " ,'" + salesM.create_id + "' " + " ,GETDATE() " + " FROM [MNDTquotes_master] " + " WHERE order_id = '" + salesM.order_id + "' "; sSql += " INSERT INTO [MNDTsales_details] " + " ([seq] " + " ,[order_id] " + " ,[product_id] " + " ,[warehouse_id] " + " ,[amount] " + " ,[price] " + " ,[description] " + " ,[create_id] " + " ,[create_datetime] " + " ,[modify_id] " + " ,[modify_datetime]) " + " SELECT Row_number() OVER(ORDER BY[product_id] ASC) NUM " + " ,[order_id] " + " ,[product_id] " + " ,'' " + " ,[modify_amount] " + " ,[modify_price] " + " ,'' " + " ,'" + salesM.create_id + "' " + " ,GETDATE() " + " ,'" + salesM.create_id + "' " + " ,GETDATE() " + " FROM [MNDTquotes_details] " + " WHERE order_id = '" + salesM.order_id + "' "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnDelete(GroupM groupM) { string sDetailsSql = " SELECT COUNT([group_id]) FROM [MNDTgroup_details] WHERE [group_id] = '" + groupM.group_id + "' "; string sCount = PublicApi.fnGetValue(sDetailsSql, "MNDT"); if (sCount == "0") { string sSql = " DELETE [MNDTgroup_master] " + " WHERE [group_id] = '" + groupM.group_id + "' "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); } return("錯誤訊息:明細資料大於一筆。"); }
public string fnVerifications(ReturnD returnD) { string sSql = " UPDATE [MNDTreturn_details] " + " SET [complete] = '" + returnD.complete + "' " + " ,[pay_complete] = '" + returnD.pay_complete + "' " + " ,[modify_id] = '" + returnD.create_id + "' " + " ,[modify_datetime] = GETDATE() " + " WHERE [return_id] = '" + returnD.return_id + "' " + " AND [seq] = '" + returnD.seq + "' "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnDelete(KindM kindM) { string sDetailsSql = " SELECT COUNT([kind_id]) FROM [MNDTkind_details] WHERE [kind_id] = '" + kindM.kind_id + "' "; string sCount = PublicApi.fnGetValue(sDetailsSql, "MNDT"); if (sCount == "0") { string sSql = " DELETE [MNDTkind_master] " + " WHERE [kind_id] = '" + kindM.kind_id + "' "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); } return("錯誤訊息:明細資料大於一筆。"); }
public string fnChangeInsert(ReceiveM receiveM) { string sSql = " INSERT INTO [dbo].[MNDTreceive_master] " + " ([order_id] " + " ,[id] " + " ,[datetime] " + " ,[complete] " + " ,[description] " + " ,[create_id] " + " ,[create_datetime]) " + " VALUES " + " ('" + receiveM.order_id + "' " + " ,'" + receiveM.create_id + "' " + " ,GETDATE() " + " ,'N' " + " ,'' " + " ,'" + receiveM.create_id + "' " + " ,GETDATE()) "; sSql += " INSERT INTO [MNDTreceive_details] " + " ([seq] " + " ,[order_id] " + " ,[material_id] " + " ,[warehouse_id] " + " ,[amount] " + " ,[price] " + " ,[complete] " + " ,[pay_complete] " + " ,[description] " + " ,[create_id] " + " ,[create_datetime] " + " ,[modify_id] " + " ,[modify_datetime]) " + " SELECT Row_number() OVER(ORDER BY[material_id] ASC) NUM " + " ,[order_id] " + " ,[material_id] " + " ,'' " + " ,[modify_amount] " + " ,[modify_price] " + " ,'N' " + " ,'N' " + " ,'' " + " ,'" + receiveM.create_id + "' " + " ,GETDATE() " + " ,'" + receiveM.create_id + "' " + " ,GETDATE() " + " FROM [MNDTpurchase_details] " + " WHERE order_id = '" + receiveM.order_id + "' "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }
public string fnUpdate(ProgramD programD) { string sSql = " UPDATE [MNDTprogram_details] " + " SET [read] = '" + programD.read + "' " + " ,[write] = '" + programD.write + "' " + " ,[execute] = '" + programD.execute + "' " + " ,[modify_id] = '" + programD.create_id + "' " + " ,[modify_datetime] = GETDATE() " + " WHERE [program_id] = '" + programD.program_id + "' " + " AND [group_id] = '" + programD.group_id + "' "; return(PublicApi.fnExecuteSQL(sSql, "MNDT")); }