Beispiel #1
0
        public PoEntryModel GetPoEntryData(string styleId, string seasonYear, string seasonName, string headOfficeId, string branchOfficeId)
        {
            PoEntryModel objPoEntryModel = new PoEntryModel();

            var sql = "SELECT " +
                      "STYLE_NO," +
                      "STYLE_NAME," +
                      "HEAD_OFFICE_ID," +
                      "BRANCH_OFFICE_ID," +
                      "SEASON_YEAR," +
                      "SEASON_ID," +
                      "SEASON_NAME," +
                      "FIT_ID," +
                      "FIT_NAME," +
                      "SIZE_ID," +
                      "OCCASION_ID," +
                      "PO_NO " +
                      " FROM VEW_PRODUCT_MAIN where STYLE_NO = '" + styleId + "' AND SEASON_YEAR = '" + seasonYear + "' AND SEASON_NAME = '" + seasonName + "' AND HEAD_OFFICE_ID = '" + headOfficeId + "' AND BRANCH_OFFICE_ID = '" + branchOfficeId + "' ";

            OracleCommand    objCommand = new OracleCommand(sql);
            OracleDataReader objDataReader;

            using (OracleConnection strConn = GetConnection())
            {
                objCommand.Connection = strConn;
                strConn.Open();
                objDataReader = objCommand.ExecuteReader();
                try
                {
                    while (objDataReader.Read())
                    {
                        objPoEntryModel.StyleNo     = objDataReader.GetValue(0).ToString();
                        objPoEntryModel.StyleName   = objDataReader.GetValue(1).ToString();
                        objPoEntryModel.SeasoneYear = objDataReader.GetValue(4).ToString();
                        objPoEntryModel.SeasoneName = objDataReader.GetValue(5).ToString();
                        objPoEntryModel.Fit         = objDataReader.GetValue(7).ToString();
                        objPoEntryModel.Occasion    = objDataReader.GetValue(10).ToString();
                        objPoEntryModel.PoNumber    = objDataReader.GetValue(11).ToString();
                    }
                }
                catch (Exception ex)
                {
                    throw new Exception("Error : " + ex.Message);
                }

                finally
                {
                    strConn.Close();
                }
            }
            return(objPoEntryModel);
        }
Beispiel #2
0
        //Save and Delete Data
        public string SavePoEntry(PoEntryModel objPoEntryModel)
        {
            string strMsg;

            OracleCommand objOracleCommand = new OracleCommand("PRO_PO_INFO_SAVE");

            objOracleCommand.CommandType = CommandType.StoredProcedure;

            objOracleCommand.Parameters.Add("P_TRAN_ID", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value = !string.IsNullOrWhiteSpace(objPoEntryModel.TranIdS) ? objPoEntryModel.TranIdS : null;

            objOracleCommand.Parameters.Add("P_PO_NO", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value = !string.IsNullOrWhiteSpace(objPoEntryModel.PoNumber) ? objPoEntryModel.PoNumber : null;

            objOracleCommand.Parameters.Add("P_STYLE_NO", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value = !string.IsNullOrWhiteSpace(objPoEntryModel.StyleNo) ? objPoEntryModel.StyleNo : null;

            objOracleCommand.Parameters.Add("P_SEASON_ID", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value = !string.IsNullOrWhiteSpace(objPoEntryModel.SeasoneName) ? objPoEntryModel.SeasoneName : null;

            objOracleCommand.Parameters.Add("P_SEASON_YEAR", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value = !string.IsNullOrWhiteSpace(objPoEntryModel.SeasoneYear) ? objPoEntryModel.SeasoneYear : null;

            objOracleCommand.Parameters.Add("P_COST_PRICE", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value = !string.IsNullOrWhiteSpace(objPoEntryModel.CostPrice) ? objPoEntryModel.CostPrice : null;

            objOracleCommand.Parameters.Add("P_RETAIL_PRICE", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value = !string.IsNullOrWhiteSpace(objPoEntryModel.RetailPrice) ? objPoEntryModel.RetailPrice : null;

            objOracleCommand.Parameters.Add("P_FABRIC_QUANTITY", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value = !string.IsNullOrWhiteSpace(objPoEntryModel.FabricQuantity) ? objPoEntryModel.FabricQuantity : null;

            objOracleCommand.Parameters.Add("P_FIT_ID", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value = !string.IsNullOrWhiteSpace(objPoEntryModel.Fit) ? objPoEntryModel.Fit : null;

            objOracleCommand.Parameters.Add("P_store_delivery_date", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value = !string.IsNullOrWhiteSpace(objPoEntryModel.StoreDeleveryDate) ? objPoEntryModel.StoreDeleveryDate : null;

            objOracleCommand.Parameters.Add("P_size_id", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value = !string.IsNullOrWhiteSpace(objPoEntryModel.SizeIdS) ? objPoEntryModel.SizeIdS : null;

            objOracleCommand.Parameters.Add("P_size_value", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value = !string.IsNullOrWhiteSpace(objPoEntryModel.SizeValueS) ? objPoEntryModel.SizeValueS : null;


            objOracleCommand.Parameters.Add("P_EMBROIDARY_YN", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value = !string.IsNullOrWhiteSpace(objPoEntryModel.EmbroidaryS) ? objPoEntryModel.EmbroidaryS : null;
            objOracleCommand.Parameters.Add("P_KARCHUPI_YN", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value   = !string.IsNullOrWhiteSpace(objPoEntryModel.KarchupiS) ? objPoEntryModel.KarchupiS : null;
            objOracleCommand.Parameters.Add("P_PRINT_YN", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value      = !string.IsNullOrWhiteSpace(objPoEntryModel.PrintS) ? objPoEntryModel.PrintS : null;
            objOracleCommand.Parameters.Add("P_WASH_YN", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value       = !string.IsNullOrWhiteSpace(objPoEntryModel.WashS) ? objPoEntryModel.WashS : null;


            objOracleCommand.Parameters.Add("P_OCCASION_ID", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value = !string.IsNullOrWhiteSpace(objPoEntryModel.Occasion) ? objPoEntryModel.Occasion : null;



            objOracleCommand.Parameters.Add("P_COLOR_WAY_NO_ID", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value = !string.IsNullOrWhiteSpace(objPoEntryModel.ColorWayNumberS) ? objPoEntryModel.ColorWayNumberS : null;

            objOracleCommand.Parameters.Add("P_COLOR_WAY_NAME", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value = !string.IsNullOrWhiteSpace(objPoEntryModel.ColorWayNameS) ? objPoEntryModel.ColorWayNameS : null;

            objOracleCommand.Parameters.Add("P_INSERT_DATE", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value = !string.IsNullOrWhiteSpace(objPoEntryModel.InsertDate) ? objPoEntryModel.InsertDate : null;



            objOracleCommand.Parameters.Add("P_UPDATE_BY", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value        = !string.IsNullOrWhiteSpace(objPoEntryModel.UpdateBy) ? objPoEntryModel.UpdateBy : null;
            objOracleCommand.Parameters.Add("p_HEAD_OFFICE_ID", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value   = !string.IsNullOrWhiteSpace(objPoEntryModel.HeadOfficeId) ? objPoEntryModel.HeadOfficeId : null;
            objOracleCommand.Parameters.Add("p_BRANCH_OFFICE_ID", OracleDbType.Varchar2, ParameterDirection.InputOutput).Value = !string.IsNullOrWhiteSpace(objPoEntryModel.BranchOfficeId) ? objPoEntryModel.BranchOfficeId : null;

            objOracleCommand.Parameters.Add("P_MESSAGE", OracleDbType.Varchar2, 500).Direction = ParameterDirection.Output;

            using (OracleConnection strConn = GetConnection())
            {
                try
                {
                    objOracleCommand.Connection = strConn;
                    strConn.Open();
                    trans = strConn.BeginTransaction();
                    objOracleCommand.ExecuteNonQuery();
                    trans.Commit();
                    strConn.Close();


                    strMsg = objOracleCommand.Parameters["P_MESSAGE"].Value.ToString();
                }

                catch (Exception ex)
                {
                    throw new Exception("Error : " + ex.Message);
                }

                finally
                {
                    strConn.Close();
                }
            }
            return(strMsg);
        }