Esempio n. 1
0
        public bool EditSubsegmentMaintenanceNew(SubsegmentModel subsegment)
        {
            var output = false;
            var conn   = @"Server=USHYDYMANIDEE12;Database=Aetna;Integrated Security=SSPI;";

            using (var con = new SqlConnection(conn))
            {
                using (SqlCommand cmd = new SqlCommand("sp_SEC_Edit_Subsegment_Maintenance_New"))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Connection  = con;
                    con.Open();

                    var subsegmentIdparam          = new SqlParameter("@subsegmentId", subsegment.SUB_SEGMENT_ID);
                    var subsegmentCodeparam        = new SqlParameter("@subSegmentCode", subsegment.SUB_SEGMENT_CD);
                    var subsegmentDescriptionparam = new SqlParameter("@subSegmentDescription", subsegment.SUB_SEGMENT_DESCR);
                    var modifiedByparam            = new SqlParameter("@modifiedUser", subsegment.ModifiedUser);
                    cmd.Parameters.Add(subsegmentIdparam);
                    cmd.Parameters.Add(subsegmentCodeparam);
                    cmd.Parameters.Add(subsegmentDescriptionparam);
                    cmd.Parameters.Add(modifiedByparam);

                    int result = cmd.ExecuteNonQuery();
                    output = true;

                    con.Close();
                }
            }
            return(output);
        }
Esempio n. 2
0
        public bool EditSubsegmentMaintenance(SubsegmentModel subsegment)
        {
            var output = false;
            var conn   = @"Server=USHYDYMANIDEE12;Database=Aetna;Integrated Security=SSPI;";

            using (var con = new SqlConnection(conn))
            {
                using (SqlCommand cmd = new SqlCommand("sp_SEC_Edit_Subsegment_Maintenance"))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Connection  = con;
                    con.Open();

                    var subsegmentIdparam = new SqlParameter("@subsegmentId", subsegment.SUB_SEGMENT_ID);
                    var columnParam       = new SqlParameter("@column", subsegment.Column);
                    var valueParam        = new SqlParameter("@value", subsegment.Value);
                    cmd.Parameters.Add(subsegmentIdparam);
                    cmd.Parameters.Add(columnParam);
                    cmd.Parameters.Add(valueParam);

                    int result = cmd.ExecuteNonQuery();
                    output = true;

                    con.Close();
                }
            }
            return(output);
        }
Esempio n. 3
0
        public string AddSubsegmentMaintenance(SubsegmentModel subsegment)
        {
            string result = "";
            var    conn   = @"Server=USHYDYMANIDEE12;Database=Aetna;Integrated Security=SSPI;";

            using (var con = new SqlConnection(conn))
            {
                using (SqlCommand cmd = new SqlCommand("sp_SEC_Add_Subsegment_Maintenance"))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Connection  = con;
                    con.Open();

                    var subsegmentCodeparam        = new SqlParameter("@subSegmentCode", subsegment.SUB_SEGMENT_CD);
                    var subsegmentDescriptionParam = new SqlParameter("@subSegmentDescription", subsegment.SUB_SEGMENT_DESCR);
                    var modifiedUserParam          = new SqlParameter("@modifiedUser", subsegment.ModifiedUser);
                    cmd.Parameters.Add(subsegmentCodeparam);
                    cmd.Parameters.Add(subsegmentDescriptionParam);
                    cmd.Parameters.Add(modifiedUserParam);

                    result = Convert.ToString(cmd.ExecuteScalar());

                    con.Close();
                }
            }
            return(result);
        }
Esempio n. 4
0
        public bool EditSubsegmentMaintenance(SubsegmentModel subsegment)
        {
            var repository = new DataAccess();
            var output     = repository.EditSubsegmentMaintenanceNew(subsegment);

            return(output);
        }
Esempio n. 5
0
        public string AddSubsegmentMaintenance(SubsegmentModel subsegment)
        {
            var repository = new DataAccess();
            var output     = repository.AddSubsegmentMaintenance(subsegment);

            return(output);
        }
Esempio n. 6
0
        public List <SubsegmentModel> GetSubsegments()
        {
            List <SubsegmentModel> output = new List <SubsegmentModel>();
            var conn = @"Server=USHYDYMANIDEE12;Database=Aetna;Integrated Security=SSPI;";

            using (var con = new SqlConnection(conn))
            {
                using (SqlCommand cmd = new SqlCommand("sp_SEC_Subsegments"))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Connection  = con;
                    con.Open();
                    SqlDataReader reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        SubsegmentModel repObj = new SubsegmentModel();
                        repObj.SUB_SEGMENT_ID    = Convert.ToInt32(reader["SUB_SEGMENT_ID"]);
                        repObj.SUB_SEGMENT_CD    = Convert.ToString(reader["SUB_SEGMENT_CD"]);
                        repObj.SUB_SEGMENT_DESCR = Convert.ToString(reader["SUB_SEGMENT_DESCR"]);
                        if (!DBNull.Value.Equals(reader["FOOTNOTE_IND"]))
                        {
                            repObj.FOOTNOTE_IND = Convert.ToString(reader["FOOTNOTE_IND"]);
                        }
                        if (!DBNull.Value.Equals(reader["CREAT_BY_ID"]))
                        {
                            repObj.CREAT_BY_ID = Convert.ToString(reader["CREAT_BY_ID"]);
                        }
                        if (!DBNull.Value.Equals(reader["CREAT_TMSTMP"]))
                        {
                            repObj.CREAT_TMSTMP = Convert.ToDateTime(reader["CREAT_TMSTMP"]);
                        }
                        if (!DBNull.Value.Equals(reader["UPDT_BY_ID"]))
                        {
                            repObj.UPDT_BY_ID = Convert.ToString(reader["UPDT_BY_ID"]);
                        }
                        if (!DBNull.Value.Equals(reader["UPDT_TMSTMP"]))
                        {
                            repObj.UPDT_TMSTMP = Convert.ToDateTime(reader["UPDT_TMSTMP"]);
                        }
                        output.Add(repObj);
                    }
                    reader.NextResult();
                    con.Close();
                }
            }
            return(output);
        }