private SqlCommand DeclareSqlCmdParameter(SqlCommand SqlCmd, DEInvoiceNo invoiceNo) { SqlCmd.Parameters.AddWithValue("@Type", invoiceNo.Type); SqlCmd.Parameters.AddWithValue("@Year", invoiceNo.Year); SqlCmd.Parameters.AddWithValue("@PreFix", invoiceNo.PreFix); SqlCmd.Parameters.AddWithValue("@Current_Id", invoiceNo.Current_Id); return(SqlCmd); }
public int InsertData(DEInvoice inv, DEInvoiceNo invNo) { DALInvoice obj_DALInvoice = new DALInvoice(); int int_Result = obj_DALInvoice.InsertData(inv, invNo); obj_DALInvoice = null; return(int_Result); }
public Boolean LoadInvoiceNoRow(DEInvoiceNo invoiceNo) { DALInvoiceNo obj_DALInvoiceNo = new DALInvoiceNo(); Boolean has_Row = obj_DALInvoiceNo.LoadInvoiceNoRow(invoiceNo); obj_DALInvoiceNo = null; return(has_Row); }
public int UpdateData(DEInvoiceNo invNo, SqlConnection SqlCon, SqlTransaction tn) { int int_Result; SqlCommand sqlCmd = new SqlCommand(" ", SqlCon, tn); sqlCmd.CommandText = "Update tbl_InvoiceNo SET Type = @Type , Year = @Year, PreFix = @PreFix , Current_Id = @Current_ID where Type = @Type"; DeclareSqlCmdParameter(sqlCmd, invNo); int_Result = SqlConjunction.GetSQLTransVoid(sqlCmd); sqlCmd = null; return(int_Result); }
private Boolean checkExpire() { Boolean check = true; DEInvoiceNo invNo = new DEInvoiceNo(); invNo.Type = 1; BLLInvoiceNo obj_BLLInvoice_No = new BLLInvoiceNo(); try { obj_BLLInvoice_No.LoadInvoiceNoRow(invNo); if (invNo.Current_Id > 125) { check = false; } } catch (Exception ex) { check = false; } return(check); }
public Boolean LoadInvoiceNoRow(DEInvoiceNo invoiceNo) { Boolean bool_HasRows = false; SqlCommand sqlCmd = new SqlCommand(); sqlCmd.CommandText = "SELECT Type,Year,PreFix,Current_Id FROM tbl_InvoiceNo Where Type=@Type"; sqlCmd = DeclareSqlCmdParameter(sqlCmd, invoiceNo); SqlConnection con = new SqlConnection(SqlConjunction.DataConn); SqlDataReader sqlDataReader = SqlConjunction.GetSQLExecuteReader(sqlCmd, con); while (sqlDataReader.Read()) { invoiceNo.Type = sqlDataReader.GetInt32(0); invoiceNo.Year = sqlDataReader.GetInt32(1); invoiceNo.PreFix = sqlDataReader.GetString(2); invoiceNo.Current_Id = sqlDataReader.GetInt32(3); } if (sqlDataReader.HasRows) { bool_HasRows = true; } else { bool_HasRows = false; } con.Close(); sqlCmd = null; return(bool_HasRows); }