/// <summary> /// 更新客戶布種單價 /// </summary> /// <returns></returns> public int UpdateCustomerTextilePrice(CustomerCheckBillSheet selectedCustomerCheckBillSheet, int updateCustomerPrice) { string sql = @"UPDATE dbo.CustomerTextilePrice SET Price = @Price WHERE AccountCustomerID = @AccountCustomerID AND AccountTextileID = @AccountTextileID"; SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@AccountCustomerID", SqlDbType.NChar) { Value = selectedCustomerCheckBillSheet.C_01 }, new SqlParameter("@AccountTextileID", SqlDbType.Int) { Value = selectedCustomerCheckBillSheet.AccountTextileID }, new SqlParameter("@Price", SqlDbType.Int) { Value = updateCustomerPrice } }; var result = DapperHelper.ExecuteParameter(AppSettingConfig.ConnectionString(), CommandType.Text, sql, parameters); return(result); }
private bool UpdateTrashSystemPrice(CustomerCheckBillSheet customerCheckBillSheet, int newPrice) { int updateCount = TrashModule.UpdateInvoSubPrice(customerCheckBillSheet, newPrice, CheckBillDate); bool updateTrashSystemsuccess = CustomerCheckBillSheets.Where(w => w.I_01 == customerCheckBillSheet.I_01 && w.F_01 == customerCheckBillSheet.F_01).Count() == updateCount; return(updateTrashSystemsuccess); }
/// <summary> /// 更新帳務系統單價 /// </summary> /// <param name="customerCheckBillSheet"></param> /// <param name="newPrice"></param> /// <param name="CheckBillDate"></param> /// <returns></returns> public int UpdateInvoSubPrice(CustomerCheckBillSheet customerCheckBillSheet, int newPrice, DateTime CheckBillDate) { string sqlCmd2 = @"UPDATE INVOSUB.dbf SET Price=@Price WHERE C_01 = @C_01 AND I_01 = @I_01 AND F_01 = @F_01 AND Month(IN_DATE) = @IN_DATE1 AND Year(IN_DATE) = @IN_DATE2"; SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@Price", SqlDbType.Int) { Value = newPrice }, new SqlParameter("@C_01", SqlDbType.NVarChar) { Value = customerCheckBillSheet.C_01 }, new SqlParameter("@I_01", SqlDbType.NVarChar) { Value = customerCheckBillSheet.I_01 }, new SqlParameter("@F_01", SqlDbType.NVarChar) { Value = customerCheckBillSheet.F_01 }, new SqlParameter("@IN_DATE1", SqlDbType.Int) { Value = CheckBillDate.Month }, new SqlParameter("@IN_DATE2", SqlDbType.Int) { Value = CheckBillDate.Year }, }; var count = DapperHelper.ExecuteDbfParameter(AppSettingConfig.DbfConnectionString(), CommandType.Text, sqlCmd2, parameters); return(count); }
/// <summary> /// 更新帳務系統單價 /// </summary> /// <param name="customerCheckBillSheet"></param> /// <param name="newPrice"></param> /// <param name="CheckBillDate"></param> /// <returns></returns> public int UpdateInvoSubPrice(CustomerCheckBillSheet customerCheckBillSheet, int newPrice, DateTime CheckBillDate) { int updateCount = TrashAdapter.UpdateInvoSubPrice(customerCheckBillSheet, newPrice, CheckBillDate); return(updateCount); }
/// <summary> /// 更新客戶布種單價 /// </summary> /// <returns></returns> public bool UpdateCustomerTextilePrice(CustomerCheckBillSheet selectedCustomerCheckBillSheet, int updateCustomerPrice) { int count = AccountSystemAdapter.UpdateCustomerTextilePrice(selectedCustomerCheckBillSheet, updateCustomerPrice); return(count == 1); }