Beispiel #1
0
        public int Update(ASSETKKF_MODEL.Data.Mssql.Mcis.msWorkStationGrp d, string userID = "", SqlTransaction transac = null)
        {
            var param = new Dapper.DynamicParameters();

            param.Add("@WorkStationGrpCd", d.WorkStationGrpCd.GetValue());
            param.Add("@WorkStationGrpNm", d.WorkStationGrpNm.GetValue());
            param.Add("@DLCost", d.DLCost);
            param.Add("@FOHCost", d.FOHCost);
            param.Add("@MDCost", d.MDCost);
            param.Add("@WorkStationCD", d.WorkStationCD.GetValue());
            param.Add("@LastUpdUsr", d.LastUpdUsr.GetValue());
            param.Add("@LastUpdDt", d.LastUpdDt);
            param.Add("@UnionDLCost", d.UnionDLCost);
            param.Add("@WorkStationNM", d.WorkStationNM.GetValue());
            param.Add("@MulEmp_flag", d.MulEmp_flag.GetValue());
            param.Add("@ExtGrp_Flag", d.ExtGrp_Flag.GetValue());
            string cmd = "";

            /*
             *     cmd = UPDATE mcis.dbo.msWorkStationGrp "+
             * "SET WorkStationGrpCd = @.WorkStationGrpCd "+
             * " , WorkStationGrpNm = @.WorkStationGrpNm "+
             * " , DLCost = @.DLCost "+
             * " , FOHCost = @.FOHCost "+
             * " , MDCost = @.MDCost "+
             * " , WorkStationCD = @.WorkStationCD "+
             * " , LastUpdUsr = @.LastUpdUsr "+
             * " , LastUpdDt = @.LastUpdDt "+
             * " , UnionDLCost = @.UnionDLCost "+
             * " , WorkStationNM = @.WorkStationNM "+
             * " , MulEmp_flag = @.MulEmp_flag "+
             * " , ExtGrp_Flag = @.ExtGrp_Flag "+
             * "WHERE WorkStationGrpCd = @.WorkStationGrpCd "+
             * " AND WorkStationGrpNm = @.WorkStationGrpNm "+
             * " AND DLCost = @.DLCost "+
             * " AND FOHCost = @.FOHCost "+
             * " AND MDCost = @.MDCost "+
             * " AND WorkStationCD = @.WorkStationCD "+
             * " AND LastUpdUsr = @.LastUpdUsr "+
             * " AND LastUpdDt = @.LastUpdDt "+
             * " AND UnionDLCost = @.UnionDLCost "+
             * " AND WorkStationNM = @.WorkStationNM "+
             * " AND MulEmp_flag = @.MulEmp_flag "+
             * " AND ExtGrp_Flag = @.ExtGrp_Flag "+
             * " ";
             */

            var res = ExecuteNonQuery(transac, cmd, param);

            return(res);
        }
Beispiel #2
0
        public int Insert(ASSETKKF_MODEL.Data.Mssql.Mcis.msWorkStationGrp d, string userID = "")
        {
            var param = new Dapper.DynamicParameters();

            param.Add("@WorkStationGrpCd", d.WorkStationGrpCd);
            param.Add("@WorkStationGrpNm", d.WorkStationGrpNm);
            param.Add("@DLCost", d.DLCost);
            param.Add("@FOHCost", d.FOHCost);
            param.Add("@MDCost", d.MDCost);
            param.Add("@WorkStationCD", d.WorkStationCD);
            param.Add("@LastUpdUsr", d.LastUpdUsr);
            param.Add("@LastUpdDt", d.LastUpdDt);
            param.Add("@UnionDLCost", d.UnionDLCost);
            param.Add("@WorkStationNM", d.WorkStationNM);
            param.Add("@MulEmp_flag", d.MulEmp_flag);
            param.Add("@ExtGrp_Flag", d.ExtGrp_Flag);
            string cmd = "INSERT INTO mcis.dbo.msWorkStationGrp " +
                         $"      (WorkStationGrpCd, WorkStationGrpNm, DLCost, FOHCost, MDCost, WorkStationCD, LastUpdUsr, LastUpdDt, UnionDLCost, WorkStationNM, MulEmp_flag, ExtGrp_Flag) " +
                         $"VALUES(@WorkStationGrpCd, @WorkStationGrpNm, @DLCost, @FOHCost, @MDCost, @WorkStationCD, @LastUpdUsr, @LastUpdDt, @UnionDLCost, @WorkStationNM, @MulEmp_flag, @ExtGrp_Flag); " +
                         $"SELECT SCOPE_IDENTITY();";

            return(ExecuteScalar <int>(cmd, param));
        }