Exemplo n.º 1
0
        public bool InsertOpeningBalanceMaster(OpeningBalanceEntity openingBalanceList)
        {
            ManageSQLConnection manageSQLConnection = new ManageSQLConnection();
            var result = manageSQLConnection.InsertOpeningBalanceMaster(openingBalanceList);

            return(result);
        }
Exemplo n.º 2
0
        public bool InsertOpeningBalanceMaster(OpeningBalanceEntity openingBalanceList)
        {
            // string Rowid = string.Empty;
            using (sqlConnection = new SqlConnection(GlobalVariable.ConnectionString))
            {
                DataSet ds = new DataSet();
                sqlCommand = new SqlCommand();
                try
                {
                    if (sqlConnection.State == 0)
                    {
                        sqlConnection.Open();
                    }
                    sqlCommand.Connection  = sqlConnection;
                    sqlCommand.CommandText = "InsertOpeningBalanceMaster";
                    sqlCommand.CommandType = CommandType.StoredProcedure;

                    sqlCommand.Parameters.AddWithValue("@GodownCode", openingBalanceList.GodownCode);
                    sqlCommand.Parameters.AddWithValue("@RegionCode", openingBalanceList.RegionCode);
                    sqlCommand.Parameters.AddWithValue("@CommodityCode", openingBalanceList.CommodityCode);
                    sqlCommand.Parameters.AddWithValue("@BookBalanceBags", openingBalanceList.BookBalanceBags);
                    sqlCommand.Parameters.AddWithValue("@BookBalanceWeight", openingBalanceList.BookBalanceWeight);
                    sqlCommand.Parameters.AddWithValue("@PhysicalBalanceBags", openingBalanceList.PhysicalBalanceBags);
                    sqlCommand.Parameters.AddWithValue("@PhysicalBalanceWeight", openingBalanceList.PhysicalBalanceWeight);
                    sqlCommand.Parameters.AddWithValue("@CumulitiveShortage", openingBalanceList.CumulitiveShortage);
                    sqlCommand.Parameters.AddWithValue("@ObDate", openingBalanceList.ObDate);
                    sqlCommand.Parameters.AddWithValue("@PurchaseRate", "0");
                    //  sqlCommand.Parameters.AddWithValue("@CurYear", "0");
                    sqlCommand.Parameters.AddWithValue("@ExportFlag", "N");
                    sqlCommand.Parameters.AddWithValue("@Excess", "0");
                    sqlCommand.Parameters.AddWithValue("@Flag1", "");
                    sqlCommand.Parameters.AddWithValue("@Flag2", "-");
                    sqlCommand.Parameters.AddWithValue("@Receipts", "0.0");
                    sqlCommand.Parameters.AddWithValue("@Issues", "0.0");
                    sqlCommand.Parameters.AddWithValue("@TransferIn", "0.0");
                    sqlCommand.Parameters.AddWithValue("@TransferOut", "0.0");
                    sqlCommand.Parameters.AddWithValue("@WriteOff", "0.0");
                    sqlCommand.Parameters.AddWithValue("@ExcessReceipt", "0.0");
                    sqlCommand.Parameters.AddWithValue("@Others", "0.0");
                    sqlCommand.Parameters.AddWithValue("@Balance", "0");
                    //sqlCommand.Parameters.Add("@Rowid", SqlDbType.NVarChar, 26);
                    //sqlCommand.Parameters["@Rowid"].Direction = ParameterDirection.Output;
                    sqlCommand.ExecuteNonQuery();

                    //  Rowid = (string)sqlCommand.Parameters["@Rowid"].Value;

                    sqlCommand.Parameters.Clear();
                    sqlCommand.Dispose();
                    //   objTrans.Commit();
                    return(true);
                }
                catch (Exception ex)
                {
                    AuditLog.WriteError(ex.Message + " : " + ex.StackTrace);
                    return(false);
                }
                finally
                {
                    if (sqlConnection.State == 0)
                    {
                        sqlConnection.Open();
                    }
                    sqlCommand.Dispose();
                    ds.Dispose();
                    dataAdapter = null;
                }
            }
        }
Exemplo n.º 3
0
        public bool Post(OpeningBalanceEntity openingBalanceEntity)
        {
            OpeningBalanceMaster openingBalance = new OpeningBalanceMaster();

            return(openingBalance.InsertOpeningBalanceMaster(openingBalanceEntity));
        }