public bool UpdateCOAInformation(mdlAccounts obj_mdlAccounts) { return obj_dalCOA.UpdateCOAInformation(obj_mdlAccounts); }
public bool SaveCOAInformation(mdlAccounts obj_mdlAccounts) { bool functionReturnValue = false; if (conn.State == ConnectionState.Open) { conn.Close(); } conn.Open(); try { SqlCommand cmd = new SqlCommand("stp_ERP_M_COA_Insert", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Clear(); cmd.Parameters.Add("@pk_ACCode", SqlDbType.VarChar, 14).Value = obj_mdlAccounts.pk_ACCode; cmd.Parameters.Add("@ACName", SqlDbType.VarChar, 150).Value = obj_mdlAccounts.ACName; cmd.Parameters.Add("@ACShortCut", SqlDbType.VarChar, 50).Value = obj_mdlAccounts.AccountShortCut; cmd.Parameters.Add("@Category", SqlDbType.VarChar, 50).Value = obj_mdlAccounts.Category; cmd.Parameters.Add("@CategoryDetail", SqlDbType.VarChar, 50).Value = obj_mdlAccounts.CategoryDetail; cmd.Parameters.Add("@ACLevel", SqlDbType.Decimal).Value = Convert.ToDouble(obj_mdlAccounts.ACLevel); cmd.Parameters.Add("@Remarks", SqlDbType.VarChar, 50).Value = obj_mdlAccounts.Remarks; cmd.Parameters.Add("@ConsolidationAC", SqlDbType.Bit).Value = Convert.ToBoolean(obj_mdlAccounts.ConsolidationAC); cmd.Parameters.Add("@ControlAC", SqlDbType.Bit).Value = Convert.ToBoolean(obj_mdlAccounts.ControlAC); cmd.Parameters.Add("@Active", SqlDbType.Bit).Value = Convert.ToBoolean(obj_mdlAccounts.Active); if (obj_mdlAccounts.ActiveFrom.Replace("/", "").Trim() == "") { cmd.Parameters.Add("@ActiveFrom", SqlDbType.Date).Value = Convert.ToDateTime("01-01-1900"); } else { cmd.Parameters.Add("@ActiveFrom", SqlDbType.Date).Value = Convert.ToDateTime(obj_mdlAccounts.ActiveFrom); } if (obj_mdlAccounts.ActiveTo.Replace("/", "").Trim() == "") { cmd.Parameters.Add("@ActiveTo", SqlDbType.Date).Value = Convert.ToDateTime("01-01-1900"); } else { cmd.Parameters.Add("@ActiveTo", SqlDbType.Date).Value = Convert.ToDateTime(obj_mdlAccounts.ActiveTo); } cmd.Parameters.Add("@Inactive", SqlDbType.Decimal).Value = Convert.ToDouble(obj_mdlAccounts.Inactive); if (obj_mdlAccounts.InactiveFrom.Replace("/", "").Trim() == "") { cmd.Parameters.Add("@InactiveFrom", SqlDbType.Date).Value = Convert.ToDateTime("01-01-1900"); } else { cmd.Parameters.Add("@InactiveFrom", SqlDbType.Date).Value = Convert.ToDateTime(obj_mdlAccounts.InactiveFrom); } if (obj_mdlAccounts.InactiveTo.Replace("/", "").Trim() == "") { cmd.Parameters.Add("@InactiveTo", SqlDbType.Date).Value = Convert.ToDateTime("01-01-1900"); } else { cmd.Parameters.Add("@InactiveTo", SqlDbType.Date).Value = Convert.ToDateTime(obj_mdlAccounts.InactiveTo); } cmd.Parameters.Add("@AddUser", SqlDbType.VarChar, 50).Value = obj_mdlAccounts.UserName; cmd.Parameters.Add("@AddDate", SqlDbType.Date).Value = Convert.ToDateTime(obj_mdlAccounts.AddDate); if (cmd.ExecuteNonQuery() != 0) { functionReturnValue = true; } else { functionReturnValue = false; } cmd.Cancel(); cmd.Dispose(); } catch (Exception) { functionReturnValue = false; } return functionReturnValue; }
public bool SaveCOAInformation(mdlAccounts obj_mdlAccounts) { return obj_dalCOA.SaveCOAInformation(obj_mdlAccounts); }