Exemplo n.º 1
0
        //Update MRP Database
        public bool DALGRNStatus(LINKPayment objPayment)
        {
            bool status    = false;
            int  GRNstatus = 9;

            try
            {
                SqlConnection conn        = DALConnManager.OpenMRP();
                SqlCommand    oSqlCommand = new SqlCommand();
                string        SqlQuery    = "WCF_UpdateStatusGRN";

                oSqlCommand.Connection  = conn;
                oSqlCommand.CommandText = SqlQuery;
                oSqlCommand.CommandType = CommandType.StoredProcedure;
                oSqlCommand.Parameters.AddWithValue("@Status", GRNstatus);
                oSqlCommand.Parameters.AddWithValue("@GRNNo", objPayment.GRNNo);

                status = new DALBase().Insert(oSqlCommand);
                DALConnManager.Close(conn);
            }
            catch (Exception ex)
            {
            }

            return(status);
        }
Exemplo n.º 2
0
        public bool DALVoucherIDStatus(LINKPayment objPayment)
        {
            bool status    = false;
            int  GRNstatus = 9;

            try
            {
                SqlConnection conn        = DALConnManager.OpenFinance();
                SqlCommand    oSqlCommand = new SqlCommand();
                string        SqlQuery    = "WCF_UpdateStatustblVoucher";

                oSqlCommand.Connection  = conn;
                oSqlCommand.CommandText = SqlQuery;
                oSqlCommand.CommandType = CommandType.StoredProcedure;
                oSqlCommand.Parameters.AddWithValue("@Status", GRNstatus);
                oSqlCommand.Parameters.AddWithValue("@VoucherID", objPayment.VoucherID);
                oSqlCommand.Parameters.AddWithValue("@ApproveDate", objPayment.ApproveDate);

                status = new DALBase().Insert(oSqlCommand);
                DALConnManager.Close(conn);
            }
            catch (Exception ex)
            {
            }

            return(status);
        }
Exemplo n.º 3
0
        public bool DALInsertInvoiceFromGRN(LINKPayment objPayment)
        {
            bool status = false;

            try
            {
                SqlConnection conn        = DALConnManager.OpenFinance();
                SqlCommand    oSqlCommand = new SqlCommand();
                string        SqlQuery    = "WCF_PaymentInserIntoInvoiceFromGRN";

                oSqlCommand.Connection  = conn;
                oSqlCommand.CommandText = SqlQuery;
                oSqlCommand.CommandType = CommandType.StoredProcedure;
                oSqlCommand.Parameters.AddWithValue("@InvoiceID", objPayment.InvoiceID);
                oSqlCommand.Parameters.AddWithValue("@GRNNo", objPayment.GRNNo);

                status = new DALBase().Insert(oSqlCommand);
                DALConnManager.Close(conn);
            }
            catch (Exception ex)
            {
            }

            return(status);
        }
Exemplo n.º 4
0
        public bool DALInsertInvoice(LINKPayment objPayment)
        {
            bool status = false;

            try
            {
                SqlConnection conn        = DALConnManager.OpenFinance();
                SqlCommand    oSqlCommand = new SqlCommand();
                string        SqlQuery    = "WCF_PaymentInserIntoInvoice";

                oSqlCommand.Connection  = conn;
                oSqlCommand.CommandText = SqlQuery;
                oSqlCommand.CommandType = CommandType.StoredProcedure;
                oSqlCommand.Parameters.AddWithValue("@InvoiceID", objPayment.InvoiceID);
                oSqlCommand.Parameters.AddWithValue("@ID", objPayment.ID);
                oSqlCommand.Parameters.AddWithValue("@InvoiceDate", objPayment.InvoiceDate);
                oSqlCommand.Parameters.AddWithValue("@Value", objPayment.Value);
                oSqlCommand.Parameters.AddWithValue("@CreateDate", objPayment.CreateDate);
                oSqlCommand.Parameters.AddWithValue("@CreateUser", objPayment.CreateUser);
                oSqlCommand.Parameters.AddWithValue("@Modifieddate", objPayment.Modifieddate);
                oSqlCommand.Parameters.AddWithValue("@ModifiedUser", objPayment.ModifiedUser);
                oSqlCommand.Parameters.AddWithValue("@Status", objPayment.Status);
                oSqlCommand.Parameters.AddWithValue("@SupplierID", objPayment.SupplierID);

                status = new DALBase().Insert(oSqlCommand);
                DALConnManager.Close(conn);
            }
            catch (Exception ex)
            {
            }

            return(status);
        }
Exemplo n.º 5
0
        public bool DALInsertVoucherFromInvoive(LINKPayment objPayment)
        {
            bool status = false;

            try
            {
                SqlConnection conn        = DALConnManager.OpenFinance();
                SqlCommand    oSqlCommand = new SqlCommand();
                string        SqlQuery    = "WCF_PaymentInserIntoVoucherFromInvoice";

                oSqlCommand.Connection  = conn;
                oSqlCommand.CommandText = SqlQuery;
                oSqlCommand.CommandType = CommandType.StoredProcedure;
                oSqlCommand.Parameters.AddWithValue("@VoucherID", objPayment.VoucherID);
                oSqlCommand.Parameters.AddWithValue("@InvoiceID", objPayment.InvoiceID);

                status = new DALBase().Insert(oSqlCommand);
                DALConnManager.Close(conn);
            }
            catch (Exception ex)
            {
                //StreamWriter file2 = new StreamWriter(@"c:\file.txt", true);
                //file2.WriteLine(ex.ToString() + "- " + DateTime.Now + "- DAL");
                //file2.Close();
            }

            return(status);
        }
Exemplo n.º 6
0
        public bool Update(string sql)
        {
            bool status      = false;
            int  rowAffected = 0;

            try
            {
                SqlConnection conn    = DALConnManager.Open();
                SqlCommand    command = new SqlCommand(sql, conn);
                rowAffected = command.ExecuteNonQuery();
                DALConnManager.Close(conn);
                if (rowAffected > 0)
                {
                    status = true;
                }
            }
            catch (SqlException ex)
            {
                throw;
            }
            return(status);
        }
Exemplo n.º 7
0
        public bool UpdateMRP(SqlCommand oSqlCommand)
        {
            bool status      = false;
            int  rowAffected = 0;

            try
            {
                SqlConnection conn = DALConnManager.OpenMRP();
                oSqlCommand.Connection  = conn;
                oSqlCommand.CommandType = CommandType.StoredProcedure;

                rowAffected = oSqlCommand.ExecuteNonQuery();
                DALConnManager.Close(conn);
                if (rowAffected > 0)
                {
                    status = true;
                }
            }
            catch (SqlException ex)
            {
                throw;
            }
            return(status);
        }