예제 #1
0
 public static COMN_MaritualStatus GetCOMN_MaritualStatusByMaritualStatusID(int MaritualStatusID)
 {
     COMN_MaritualStatus cOMN_MaritualStatus = new COMN_MaritualStatus();
     SqlCOMN_MaritualStatusProvider sqlCOMN_MaritualStatusProvider = new SqlCOMN_MaritualStatusProvider();
     cOMN_MaritualStatus = sqlCOMN_MaritualStatusProvider.GetCOMN_MaritualStatusByMaritualStatusID(MaritualStatusID);
     return cOMN_MaritualStatus;
 }
예제 #2
0
 private void showCOMN_MaritualStatusData()
 {
     COMN_MaritualStatus cOMN_MaritualStatus  = new COMN_MaritualStatus ();
      	cOMN_MaritualStatus = COMN_MaritualStatusManager.GetCOMN_MaritualStatusByMaritualStatusID(Int32.Parse(Request.QueryString["ID"]));
     if (cOMN_MaritualStatus != null)
     {
         txtMaritualStatusName.Text = cOMN_MaritualStatus.MaritualStatusName.ToString();
     }
 }
예제 #3
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     COMN_MaritualStatus cOMN_MaritualStatus = new COMN_MaritualStatus ();
     cOMN_MaritualStatus.MaritualStatusID=  int.Parse(Request.QueryString["ID"].ToString());
     cOMN_MaritualStatus.MaritualStatusName=  txtMaritualStatusName.Text;
     cOMN_MaritualStatus.AddedBy=  Profile.card_id;
     cOMN_MaritualStatus.AddedDate=  DateTime.Now;
     cOMN_MaritualStatus.ModifiedBy=  Profile.card_id;
     cOMN_MaritualStatus.ModifiedDate=  DateTime.Now;
     bool  resutl =COMN_MaritualStatusManager.UpdateCOMN_MaritualStatus(cOMN_MaritualStatus);
     Response.Redirect("AdminDisplayCOMN_MaritalStatus.aspx");
 }
예제 #4
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     COMN_MaritualStatus cOMN_MaritualStatus = new COMN_MaritualStatus ();
     //	cOMN_MaritualStatus.MaritualStatusID=  int.Parse(ddlMaritualStatusID.SelectedValue);
     cOMN_MaritualStatus.MaritualStatusName=  txtMaritualStatusName.Text;
     cOMN_MaritualStatus.AddedBy=  Profile.card_id;
     cOMN_MaritualStatus.AddedDate=  DateTime.Now;
     cOMN_MaritualStatus.ModifiedBy=  Profile.card_id;
     cOMN_MaritualStatus.ModifiedDate=  DateTime.Now;
     int resutl =COMN_MaritualStatusManager.InsertCOMN_MaritualStatus(cOMN_MaritualStatus);
     Response.Redirect("AdminDisplayCOMN_MaritalStatus.aspx");
 }
예제 #5
0
 public static bool UpdateCOMN_MaritualStatus(COMN_MaritualStatus cOMN_MaritualStatus)
 {
     SqlCOMN_MaritualStatusProvider sqlCOMN_MaritualStatusProvider = new SqlCOMN_MaritualStatusProvider();
     return sqlCOMN_MaritualStatusProvider.UpdateCOMN_MaritualStatus(cOMN_MaritualStatus);
 }
예제 #6
0
 public static int InsertCOMN_MaritualStatus(COMN_MaritualStatus cOMN_MaritualStatus)
 {
     SqlCOMN_MaritualStatusProvider sqlCOMN_MaritualStatusProvider = new SqlCOMN_MaritualStatusProvider();
     return sqlCOMN_MaritualStatusProvider.InsertCOMN_MaritualStatus(cOMN_MaritualStatus);
 }
예제 #7
0
    public COMN_MaritualStatus GetCOMN_MaritualStatusFromReader(IDataReader reader)
    {
        try
        {
            COMN_MaritualStatus cOMN_MaritualStatus = new COMN_MaritualStatus
                (

                     DataAccessObject.IsNULL<int>(reader["MaritualStatusID"]),
                     DataAccessObject.IsNULL<string>(reader["MaritualStatusName"]),
                     DataAccessObject.IsNULL<string>(reader["AddedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["AddedDate"]),
                     DataAccessObject.IsNULL<string>(reader["ModifiedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["ModifiedDate"])
                );
            //cOMN_MaritualStatus.RowStatusID = DataAccessObject.IsNULL<int>(reader["RowStatusID"]);
             return cOMN_MaritualStatus;
        }
        catch(Exception ex)
        {
            return null;
        }
    }
예제 #8
0
    public bool UpdateCOMN_MaritualStatus(COMN_MaritualStatus cOMN_MaritualStatus)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("UpdateCOMN_MaritualStatus", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@MaritualStatusID", SqlDbType.Int).Value = cOMN_MaritualStatus.MaritualStatusID;
            cmd.Parameters.Add("@MaritualStatusName", SqlDbType.NVarChar).Value = cOMN_MaritualStatus.MaritualStatusName;
            cmd.Parameters.Add("@ModifiedBy", SqlDbType.NVarChar).Value = cOMN_MaritualStatus.ModifiedBy;
            cmd.Parameters.Add("@ModifiedDate", SqlDbType.DateTime).Value = cOMN_MaritualStatus.ModifiedDate;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return result == 1;
        }
    }
예제 #9
0
    public int InsertCOMN_MaritualStatus(COMN_MaritualStatus cOMN_MaritualStatus)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("InsertCOMN_MaritualStatus", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@MaritualStatusID", SqlDbType.Int).Direction = ParameterDirection.Output;
            cmd.Parameters.Add("@MaritualStatusName", SqlDbType.NVarChar).Value = cOMN_MaritualStatus.MaritualStatusName;
            cmd.Parameters.Add("@AddedBy", SqlDbType.NVarChar).Value = cOMN_MaritualStatus.AddedBy;
            cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = cOMN_MaritualStatus.AddedDate;
            cmd.Parameters.Add("@ModifiedBy", SqlDbType.NVarChar).Value = cOMN_MaritualStatus.ModifiedBy;
            cmd.Parameters.Add("@ModifiedDate", SqlDbType.DateTime).Value = cOMN_MaritualStatus.ModifiedDate;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return (int)cmd.Parameters["@MaritualStatusID"].Value;
        }
    }