public static Model.CustomerSetting GetCustomerSetting(int customerSysNo) { IDataCommand dataCommand = DataCommandManager.GetCommand("Customer_GetCustomerSetting"); dataCommand.SetParameter("@CustomerSysNo", customerSysNo); return(dataCommand.ExecuteEntity <Model.CustomerSetting>()); }
public static Model.RetrieveTask RetrieveTask(int customerSysNo) { IDataCommand dataCommand = DataCommandManager.GetCommand("Task_RetrieveTask"); dataCommand.SetParameter("@CustomerSysNo", customerSysNo); return(dataCommand.ExecuteEntity <Model.RetrieveTask>()); }
public static void SaveCustomerSetting(Model.CustomerSetting customerSetting) { IDataCommand dataCommand = DataCommandManager.GetCommand("Customer_SaveCustomerSetting"); dataCommand.SetParameter("@CustomerSysNo", customerSetting.CustomerSysNo); dataCommand.SetParameter("@Setting", customerSetting.Setting); dataCommand.ExecuteNonQuery(); customerSetting.SysNo = Convert.ToInt32(dataCommand.Parameters["@SysNo"].Value); }
public static Model.Customer CustomerDetail(Model.Customer customer) { IDataCommand dataCommand = DataCommandManager.GetCommand("Customer_CustomerDetail"); dataCommand.SetParameter("@CustomerID", customer.CustomerID); Model.Customer customerInfo = dataCommand.ExecuteEntity <Model.Customer>(); return(customerInfo); }
public static void UpdateRetrieveTaskStatus(Model.RetrieveTask retrieveTask) { IDataCommand dataCommand = DataCommandManager.GetCommand("Task_UpdateRetrieveTaskStatus"); dataCommand.SetParameter("@TaskSysNo", retrieveTask.RunTaskSysNo); dataCommand.SetParameter("@RetrieveTask", retrieveTask.SysNo); dataCommand.SetParameter("@Status", retrieveTask.Status); dataCommand.SetParameter("@Description", retrieveTask.Description); dataCommand.ExecuteNonQuery(); }
public static bool Login(Model.Customer customer) { IDataCommand dataCommand = DataCommandManager.GetCommand("Customer_Login"); dataCommand.SetParameter("@CustomerID", customer.CustomerID); dataCommand.SetParameter("@Password", customer.Password); int result = dataCommand.ExecuteScalar <int>(); return(result == 1); }
public static bool Register(Model.Customer customer) { IDataCommand dataCommand = DataCommandManager.GetCommand("Customer_Register"); dataCommand.SetParameter("@CustomerID", customer.CustomerID); dataCommand.SetParameter("@Name", customer.Name); dataCommand.SetParameter("@QQ", customer.QQ); dataCommand.SetParameter("@Amount", customer.Account == null ? 0M : customer.Account.Amount); dataCommand.SetParameter("@Password", customer.Password); dataCommand.ExecuteNonQuery(); int result = Convert.ToInt32(dataCommand.Parameters["@Result"].Value); return(result == 1); }
public static int CreateTask(Model.Task task) { IDataCommand dataCommand = DataCommandManager.GetCommand("Task_CreateTask"); dataCommand.SetParameter("@CustomerSysNo", task.CustomerSysNo); dataCommand.SetParameter("@CustomerSettingSysNo", task.Setting.SysNo); dataCommand.SetParameter("@RunTimes", task.RunTimes); dataCommand.SetParameter("@BeginDate", task.BeginDate); if (task.EndDate == DateTime.MinValue) { dataCommand.SetParameter("@EndDate", null); } else { dataCommand.SetParameter("@EndDate", task.EndDate); } dataCommand.SetParameter("@Costs", task.Costs); dataCommand.ExecuteNonQuery(); int result = Convert.ToInt32(dataCommand.Parameters["@Result"].Value); return(result); }