Esempio n. 1
0
 /// <summary>
 /// this function convert the model to table form
 /// </summary>
 /// <param name="model"></param> the convertable model
 /// <returns></returns> returns the converted table
 public DataLayer.PP_InputOutputInfo ConvertToTable(InputOutputInfoModel model)
 {
     DataLayer.PP_InputOutputInfo tbl = new DataLayer.PP_InputOutputInfo();
     tbl.InputOutputID            = model.InputOutputID;
     tbl.InputOutputCode          = model.InputOutputCode;
     tbl.InputOutputIndicator     = model.InputOutputIndicator;
     tbl.ScheduleProductionLineID = model.ScheduleProductionLineID;
     tbl.UserID         = model.UserID;
     tbl.YearID         = model.YearID;
     tbl.BranchID       = model.BranchID;
     tbl.RegisteredDate = model.RegisteredDate;
     return(tbl);
 }
Esempio n. 2
0
        /// <summary>
        /// this function conver the table form to model
        /// </summary>
        /// <param name="tbl"></param> the covertable table
        /// <returns></returns>the converted model
        public InputOutputInfoModel ConvertToModel(DataLayer.PP_InputOutputInfo tbl)
        {
            InputOutputInfoModel model = new InputOutputInfoModel();

            model.InputOutputID            = tbl.InputOutputID;
            model.InputOutputCode          = tbl.InputOutputCode;
            model.InputOutputIndicator     = tbl.InputOutputIndicator;
            model.ScheduleProductionLineID = tbl.ScheduleProductionLineID;
            model.UserID         = tbl.UserID;
            model.YearID         = tbl.YearID;
            model.BranchID       = tbl.BranchID;
            model.RegisteredDate = tbl.RegisteredDate;
            return(model);
        }
Esempio n. 3
0
        /// <summary>
        /// this function copy the model for edit
        /// </summary>
        /// <param name="model"></param> the model should be edited
        /// <returns></returns> returns if the copy is successfull
        public Boolean Edit(InputOutputInfoModel model)
        {
            Boolean result = true;

            try
            {
                IsEdit = true;
                _model = model;
            }
            catch (Exception ex)
            {
                result = false;
            }
            return(result);
        }
Esempio n. 4
0
        /// <summary>
        /// this function copy the models to save
        /// </summary>
        /// <param name="model"></param> the copyable model
        /// <returns></returns> returns if the copy is successfull
        public Boolean Add(InputOutputInfoModel model)
        {
            Boolean result = true;

            try
            {
                _model                = model;
                _model.BranchID       = CRMStaticData.StaticData.getBranchID;
                _model.RegisteredDate = CRMStaticData.StaticData.getRegisteredDate;
                _model.UserID         = CRMStaticData.StaticData.getUserID;
                _model.YearID         = CRMStaticData.StaticData.getYearID;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
            return(result);
        }