示例#1
0
        /// <summary>
        /// 비가동 상세 추가
        /// </summary>
        public bool InsertUpdateNop_Mi_Master(NopMiMasterVO item)
        {
            try
            {
                using (SqlCommand comm = new SqlCommand())
                {
                    comm.Connection  = new SqlConnection(Connstr);
                    comm.CommandText =
                        @"IF NOT EXISTS (SELECT Nop_Mi_Code FROM [dbo].[Nop_Mi_Master] WHERE Nop_Mi_Code=@Nop_Mi_Code)
BEGIN
	INSERT INTO [Nop_Mi_Master](Nop_Ma_Code,Nop_Mi_Code,Nop_Mi_Name,Remark,Ins_Date) VALUES(@Nop_Ma_Code,@Nop_Mi_Code,@Nop_Mi_Name,@Remark,GETDATE())
END
ELSE
BEGIN
UPDATE [Nop_Mi_Master] SET Nop_Mi_Name=@Nop_Mi_Name, Remark=@Remark,Up_Date=GETDATE() WHERE Nop_Mi_Code=@Nop_Mi_Code
END";
                    comm.CommandType = CommandType.Text;
                    comm.Parameters.AddWithValue("@Nop_Ma_Code", item.Nop_Ma_Code);
                    comm.Parameters.AddWithValue("@Nop_Mi_Code", item.Nop_Mi_Code);
                    comm.Parameters.AddWithValue("@Nop_Mi_Name", item.Nop_Mi_Name);
                    comm.Parameters.AddWithValue("@Remark", item.Remark);

                    comm.Connection.Open();
                    int result = comm.ExecuteNonQuery();

                    comm.Connection.Close();

                    if (result > 0)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#2
0
        public bool InsertUpdateNop_Mi_Masterservice(NopMiMasterVO item)
        {
            Nop_Mi_MasterDAC dac = new Nop_Mi_MasterDAC();

            return(dac.InsertUpdateNop_Mi_Master(item));
        }