Ejemplo n.º 1
0
        /// <summary>
        /// Insert uketori detail
        /// </summary>
        /// <param name="lstFuzokuhin"></param>
        /// <param name="errMsg"></param>
        public void DCW003InsertDocUketoriDetail(List <DCW003UketoriUpdate> lstUpdate, List <DCW003UketoriDetail> lstDetail, out string errMsg)
        {
            DataTable tblDetail = new DataTable();

            tblDetail = EntityHelper <DCW003UketoriDetail> .ConvertToDataTable(lstDetail);

            if (tblDetail == null)
            {
                tblDetail = new DataTable();
                tblDetail.Columns.Add("DocControlNo", typeof(string));
                tblDetail.Columns.Add("DocFuzokuhinCd", typeof(string));
                tblDetail.Columns.Add("DocCount", typeof(int));
                tblDetail.Columns.Add("Note", typeof(string));
                tblDetail.Columns.Add("IsChecked", typeof(int));
            }
            using (DBManager DbManager = new DBManager(DWC003StoreName.STP_DCW003_INSERT_DOC_UKETORI_DETAIL))
            {
                DbManager.Add(DWC003StoreName.PARAM_LIST_UKETORI_UPDATE, SqlDbType.Structured, EntityHelper <DCW003UketoriUpdate> .ConvertToDataTable(lstUpdate));
                DbManager.Add(DWC003StoreName.PARAM_LIST_UKETORI_DETAIL, SqlDbType.Structured, tblDetail);
                DbManager.Add(DWC003StoreName.PARAM_USER, CmnEntityModel.UserName);
                DbManager.Add(DWC003StoreName.PARAM_ERROR_MSG, SqlDbType.VarChar, 500, ParameterDirection.Output);

                DbManager.ExecuteNonQuery();

                // Output error message
                errMsg = DbManager.GetValueInString(DWC003StoreName.PARAM_ERROR_MSG);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Insert Jishamei Massho
        /// </summary>
        /// <param name="lstCsv"></param>
        public void DCW003InsertJishameiMassho(List <DCW003CsvModel> lstCsv)
        {
            using (DBManager DbManager = new DBManager(DWC003StoreName.STP_DCW003_INSERT_JISHAMEI_MASSHO))
            {
                DbManager.Add(DWC003StoreName.PARAM_LIST_CSV, SqlDbType.Structured, EntityHelper <DCW003CsvModel> .ConvertToDataTable(lstCsv));
                DbManager.Add(DWC003StoreName.PARAM_USER, CmnEntityModel.UserName);

                DbManager.ExecuteNonQuery();
            }
        }
Ejemplo n.º 3
0
        //TRAMD ADD PHASE 2 IMPORT 5
        public void DCW003InsertHensoIf(List <DCW003CsvModel> lstCsvTempHenso)
        {
            using (DBManager DbManager = new DBManager(DWC003StoreName.STP_DCW003_INSERT_HENSO_IF))
            {
                DbManager.Add(DWC003StoreName.PARAM_LIST_CSV, SqlDbType.Structured, EntityHelper <DCW003CsvModel> .ConvertToDataTable(lstCsvTempHenso));
                DbManager.Add(DWC003StoreName.PARAM_USER, CmnEntityModel.UserName);

                DbManager.ExecuteNonQuery();
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Get doc control from master
        /// </summary>
        /// <param name="lstRfid"></param>
        /// <returns></returns>
        public List <DCW003Result> DCW003GetDocControlMaster(List <DCW003RFID> lstRfid, int pageIndex, int pageSize, out int rowCount)
        {
            using (DBManager DbManager = new DBManager(DWC003StoreName.STP_DCW003_GET_DOC_CONTROL_MASTER))
            {
                DbManager.Add(DWC003StoreName.PARAM_LIST_RFID, SqlDbType.Structured, EntityHelper <DCW003RFID> .ConvertToDataTable(lstRfid));
                DbManager.Add(DWC003StoreName.PARAM_PAGE_INDEX, pageIndex);
                DbManager.Add(DWC003StoreName.PARAM_PAGE_SIZE, pageSize);
                DataTable tableResult = DbManager.GetDataTable();
                rowCount = tableResult.Rows.Count;

                return(Entities.EntityHelper <DCW003Result> .GetListObject(tableResult));
            }
        }
Ejemplo n.º 5
0
 public List <DCW003Result> DCW003GetHenSoIf(List <DCW003CsvModel> lstCsv, int pageIndex, int pageSize, int modeSearch, out int rowCount)
 {
     using (DBManager DbManager = new DBManager(DWC003StoreName.STP_DCW003_GET_HENSO_IF))
     {
         DbManager.Add(DWC003StoreName.PARAM_LIST_CSV, SqlDbType.Structured, EntityHelper <DCW003CsvModel> .ConvertToDataTable(lstCsv));
         DbManager.Add(DWC003StoreName.PARAM_MODE_SEARCH, modeSearch);
         DbManager.Add(DWC003StoreName.PARAM_PAGE_INDEX, pageIndex);
         DbManager.Add(DWC003StoreName.PARAM_PAGE_SIZE, pageSize);
         DataTable tableResult = DbManager.GetDataTable();
         rowCount = tableResult.Rows.Count;
         return(Entities.EntityHelper <DCW003Result> .GetListObject(tableResult));
     }
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Insert Doc Uketori Detail IF
        /// </summary>
        /// <param name="lstCsv"></param>
        /// <param name="errMsg"></param>
        public void DCW003InsertDocUketoriIf(List <DCW003CsvModel> lstCsv, out string errMsg)
        {
            using (DBManager DbManager = new DBManager(DWC003StoreName.STP_DCW003_INSERT_DOC_UKETORI_IF))
            {
                DbManager.Add(DWC003StoreName.PARAM_LIST_CSV, SqlDbType.Structured, EntityHelper <DCW003CsvModel> .ConvertToDataTable(lstCsv));
                DbManager.Add(DWC003StoreName.PARAM_USER, CmnEntityModel.UserName);
                DbManager.Add(DWC003StoreName.PARAM_ERROR_MSG, SqlDbType.VarChar, 500, ParameterDirection.Output);

                DbManager.ExecuteNonQuery();

                // Output error message
                errMsg = DbManager.GetValueInString(DWC003StoreName.PARAM_ERROR_MSG);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Insert Doc Control
        /// </summary>
        /// <param name="lstCsv"></param>
        /// <param name="lstError"></param>
        /// <param name="lstNoMap"></param>
        /// <param name="lstImport"></param>
        public void DCW003ImportCsv(List <DCW003CsvModel> lstCsv, out string lstError, out string lstNoMap, out string lstImport, out string lstDocControlNo)
        {
            using (DBManager DbManager = new DBManager(DWC003StoreName.STP_DCW003_IMPORT_CSV))
            {
                DbManager.Add(DWC003StoreName.PARAM_LIST_CSV, SqlDbType.Structured, EntityHelper <DCW003CsvModel> .ConvertToDataTable(lstCsv));
                DbManager.Add(DWC003StoreName.PARAM_USER, CmnEntityModel.UserName);
                DbManager.Add(DWC003StoreName.PARAM_LIST_ERROR, SqlDbType.VarChar, 500, ParameterDirection.Output);
                DbManager.Add(DWC003StoreName.PARAM_LIST_NO_MAP, SqlDbType.VarChar, 500, ParameterDirection.Output);
                DbManager.Add(DWC003StoreName.PARAM_LIST_IMPORT, SqlDbType.VarChar, 500, ParameterDirection.Output);
                DbManager.Add(DWC003StoreName.PARAM_LIST_DOC_CONTROL_NO, SqlDbType.VarChar, 500, ParameterDirection.Output);

                DbManager.ExecuteNonQuery();

                // Output error message
                lstError        = DbManager.GetValueInString(DWC003StoreName.PARAM_LIST_ERROR);
                lstNoMap        = DbManager.GetValueInString(DWC003StoreName.PARAM_LIST_NO_MAP);
                lstImport       = DbManager.GetValueInString(DWC003StoreName.PARAM_LIST_IMPORT);
                lstDocControlNo = DbManager.GetValueInString(DWC003StoreName.PARAM_LIST_DOC_CONTROL_NO);
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Insert auto search
        /// </summary>
        /// <param name="lstUpdate"></param>
        public void DCW003InsertAutoSearch(List <DCW003Update> lstUpdate, out string lstSuccess, out string lstError)
        {
            using (DBManager DbManager = new DBManager(DWC003StoreName.STP_DCW003_INSERT_AUTO_SEARCH))
            {
                DbManager.Add(DWC003StoreName.PARAM_LIST_UPDATE, SqlDbType.Structured, EntityHelper <DCW003Update> .ConvertToDataTable(lstUpdate));
                DbManager.Add(DWC003StoreName.PARAM_USER, CmnEntityModel.UserName);
                DbManager.Add(DWC003StoreName.PARAM_LIST_SUCCESS, SqlDbType.VarChar, 500, ParameterDirection.Output);
                DbManager.Add(DWC003StoreName.PARAM_LIST_ERROR, SqlDbType.VarChar, 500, ParameterDirection.Output);

                DbManager.ExecuteNonQuery();

                lstSuccess = DbManager.GetValueInString(DWC003StoreName.PARAM_LIST_SUCCESS);
                lstError   = DbManager.GetValueInString(DWC003StoreName.PARAM_LIST_ERROR);
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Update all
        /// </summary>
        /// <param name="lstUpdate"></param>
        public void DCW003UpdateAll(List <DCW003Update> lstUpdate)
        {
            using (DBManager DbManager = new DBManager(DWC003StoreName.STP_DCW003_UPDATE_ALL_DOC_CONTROL))
            {
                DbManager.Add(DWC003StoreName.PARAM_LIST_UPDATE, SqlDbType.Structured, EntityHelper <DCW003Update> .ConvertToDataTable(lstUpdate));
                DbManager.Add(DWC003StoreName.PARAM_USER, CmnEntityModel.UserName);

                DbManager.ExecuteNonQuery();
            }
        }
Ejemplo n.º 10
0
 public void DCW003ExportCSVLinkGHQ(List <DCW003UketoriExportCSVLinkGHQ> lstExportCSVLinkGHQ, out string errMsg)
 {
     using (DBManager DbManager = new DBManager(DWC003StoreName.STP_DCW003_EXPORT_CSV_LINK_GHQ))
     {
         DbManager.Add(DWC003StoreName.PARAM_EXPORT_CSV_LINK_GHQ, SqlDbType.Structured, EntityHelper <DCW003UketoriExportCSVLinkGHQ> .ConvertToDataTable(lstExportCSVLinkGHQ));
         DbManager.Add(DWC003StoreName.PARAM_USER, CmnEntityModel.UserName);
         DbManager.Add(DWC003StoreName.PARAM_ERROR_MSG, SqlDbType.VarChar, 5, ParameterDirection.Output);
         DbManager.ExecuteNonQuery();
         // Output error message
         errMsg = DbManager.GetValueInString(DWC003StoreName.PARAM_ERROR_MSG);
     }
 }
Ejemplo n.º 11
0
        public static DataTable GetShiireNo(List <string> listOrderNo, bool?isBilling = null)
        {
            JavaScriptSerializer jss = new JavaScriptSerializer();

            #region Get DataTable from input parameter
            // Set list item to insert to db.
            DataTable tableOrder = new DataTable();

            // Define datatable property
            tableOrder.Columns.Add("OrderNo", typeof(string));

            if (listOrderNo != null)
            {
                // Loop and add data to datatable
                foreach (string order in listOrderNo)
                {
                    // Add value for row
                    DataRow row = tableOrder.NewRow();
                    row["OrderNo"] = order;

                    // Add row to table
                    tableOrder.Rows.Add(row);
                }
            }
            #endregion

            using (var service = new CmnService())
            {
                List <CmnShiireNo> listShiireNo = service.GetShiireNoService(tableOrder, isBilling);
                List <CmnShiireNo> listNeedGetShiireNoFromService =
                    listShiireNo.Where(x => x.TapsOrderFlg.HasValue && x.TapsOrderFlg.Value.Equals(true)).ToList();

                string parameterGetShiireNo =
                    jss.Serialize(
                        listNeedGetShiireNoFromService.Select(
                            a => new { TEMPO_CD = a.TEMPO_CD, SHODAN_KANRI_NO = a.SHODAN_KANRI_NO, SHODAN_KANRI_EDA_NO = a.SHODAN_KANRI_EDA_NO }));

                Log.SaveLogToFile(Log.LogLevel.INFO,
                                  "GetShiireNo",
                                  "FromDB",
                                  "",
                                  "",
                                  parameterGetShiireNo,
                                  "");

                string getShiireNoFromService = GetSiireNoList(parameterGetShiireNo);

                Log.SaveLogToFile(Log.LogLevel.INFO,
                                  "GetShiireNo",
                                  "FromWebService",
                                  "",
                                  "",
                                  getShiireNoFromService,
                                  "");

                if (!string.IsNullOrWhiteSpace(getShiireNoFromService))
                {
                    List <CmnShiireNo> listGetShiireNoFromService = jss.Deserialize <List <CmnShiireNo> >(getShiireNoFromService);
                    if (listGetShiireNoFromService != null && listGetShiireNoFromService.Count > 0)
                    {
                        foreach (var item in listNeedGetShiireNoFromService)
                        {
                            string sss =
                                listGetShiireNoFromService.Find(
                                    x => x.TEMPO_CD == item.TEMPO_CD && x.SHODAN_KANRI_EDA_NO == item.SHODAN_KANRI_EDA_NO &&
                                    x.SHODAN_KANRI_NO == item.SHODAN_KANRI_NO).SHIIRE_NO;
                            item.SHIIRE_NO = sss ?? item.SHIIRE_NO;
                        }
                    }

                    return(EntityHelper <CmnShiireNo> .ConvertToDataTable(listNeedGetShiireNoFromService));
                }
            }

            return(null);
        }