Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using cpcit.framework.Database;
- using cpcit.framework.Helpers;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Data;
- using System.Data.SqlClient;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace cpcit.services.dynamiccode.tables.HC.ITRH_FORMULA
- {
- public static class BeforeInsert
- {
- public static string Run(string Tenant, object[] Params, SqlCommand SQLCommand)
- {
- return "";
- }
- }
- public static class BeforeUpdate
- {
- public static string Run(string Tenant, object[] Params, SqlCommand SQLCommand)
- {
- return "";
- }
- }
- public static class BeforeDelete
- {
- public static void Run(string Tenant, SqlCommand sqlCommand)
- {
- Hashtable hashParams = PageHelper.ParametersToHastable(sqlCommand.Parameters);
- string code = hashParams["Code"].ToString();
- WcfTable tableMovimento = new WcfTable(Tenant, "ITRH_MOVIMENTO");
- DataTable dt = tableMovimento.GetList("Code", new object[] { "FORMULA_ID", code }, "", sqlCommand.Transaction);
- if (dt.Rows.Count > 0)
- {
- throw new Exception("Esta Formula Contem Movimentos!");
- }
- }
- }
- public class AfterDelete
- {
- public static string Run(string Tenant, object[] Params, SqlCommand SQLCommand)
- {
- Hashtable hashParams = PageHelper.ParamsToHashtable(Params);
- string code = hashParams["Code"].ToString();
- WcfTable tableFormulasDetalhes = new WcfTable(Tenant, "ITRH_FORMULA_DETALHE");
- DataTable dt = tableFormulasDetalhes.GetList("Entry No", new object[] { "FORMULA Code", code }, "", SQLCommand.Transaction);
- foreach (DataRow row in dt.Rows)
- {
- tableFormulasDetalhes.Delete(new object[]{
- "Original_Entry No",row["Entry No"],
- "Identity.Name",""
- }, SQLCommand.Transaction);
- }
- return "";
- }
- }
- public static class AfterInsert
- {
- public static string Run(string Tenant, object[] Params, SqlCommand SQLCommand)
- {
- return "";
- }
- }
- public static class AfterUpdate
- {
- public static string Run(string Tenant, object[] Params, SqlCommand SQLCommand)
- {
- return "";
- }
- }
- public static class VerifyRecord
- {
- public static void Run(string Tenant, Boolean inserting, DataRow row, SqlCommand sqlCommand)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement