示例#1
0
    public int DeleteUser(UserListUI userListUI)
    {
        int result = 0;

        result = userListDAL.DeleteUser(userListUI);
        return(result);
    }
示例#2
0
    private void SearchHoldRemovedByList()
    {
        try
        {
            UserListUI userListUI = new UserListUI();
            userListUI.Search = txtHoldRemovedBySearch.Text;
            DataTable dtb = userListBAL.GetUserListBySearchParameters(userListUI);

            if (dtb.Rows.Count > 0 && dtb != null)
            {
                gvHoldRemovedBySearch.DataSource = dtb;
                gvHoldRemovedBySearch.DataBind();
                divHoldRemovedBySearchError.Visible = false;
            }
            else
            {
                divHoldRemovedBySearchError.Visible = true;
                lblHoldRemovedBySearchError.Text    = Resources.GlobalResource.msgNoRecordFound;
                gvHoldRemovedBySearch.Visible       = false;
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "SearchHoldRemovedBy()";
            logExcpUIobj.ResourceName     = "Assets_AssetDisposal_AssetDisposalForm.CS";
            logExcpUIobj.RecordId         = "All";
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[Assets_AssetDisposal_AssetDisposalForm : SearchHoldRemovedByList] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
示例#3
0
    public DataTable GetUserListBySearchParameters(UserListUI userListUI)
    {
        DataTable dtb = new DataTable();

        dtb = userListDAL.GetUserListBySearchParameters(userListUI);
        return(dtb);
    }
示例#4
0
    public DataTable GetUserListById(UserListUI userListUI)
    {
        DataTable dtb = new DataTable();

        dtb = userListDAL.GetUserListById(userListUI);
        return(dtb);
    }
示例#5
0
 public void SetContent(AccountInfo _info, UserListUI _userListUI)
 {
     info          = _info;
     userListUI    = _userListUI;
     nameText.text = info.name;
     sexText.text  = info.sex == 0 ? "男" : "女";
     ageText.text  = (DateTime.Now.Year - int.Parse(info.birthday.Split('-')[0])).ToString();
     dateText.text = info.birthday;
 }
示例#6
0
    public DataTable GetUserListById(UserListUI UserListUI)
    {
        DataSet ds = new DataSet();

        DataTable dtbl = new DataTable();

        try
        {
            using (SqlConnection SupportCon = new SqlConnection(connectionString))
            {
                SqlCommand sqlCmd = new SqlCommand("SP_User_SelectById", SupportCon);
                sqlCmd.CommandType    = CommandType.StoredProcedure;
                sqlCmd.CommandTimeout = commandTimeout;

                sqlCmd.Parameters.Add("@tbl_UserId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_UserId"].Value = UserListUI.Tbl_UserId;

                using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd))
                {
                    adapter.Fill(ds);
                }
            }
            if (ds.Tables.Count > 0)
            {
                dtbl = ds.Tables[0];
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "getUserListById()";
            logExcpUIobj.ResourceName     = "UserListDAL.CS";
            logExcpUIobj.RecordId         = UserListUI.Tbl_UserId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[UserListDAL : getUserListById] An error occured in the processing of Record Id : " + UserListUI.Tbl_UserId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
示例#7
0
    public int DeleteUser(UserListUI UserListUI)
    {
        int result = 0;

        try
        {
            using (SqlConnection SupportCon = new SqlConnection(connectionString))
            {
                SupportCon.Open();
                SqlCommand sqlCmd = new SqlCommand("SP_User_Delete", SupportCon);

                sqlCmd.CommandType    = CommandType.StoredProcedure;
                sqlCmd.CommandTimeout = commandTimeout;

                sqlCmd.Parameters.Add("@tbl_UserId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_UserId"].Value = UserListUI.Tbl_UserId;

                result = sqlCmd.ExecuteNonQuery();

                sqlCmd.Dispose();
                SupportCon.Close();
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "DeleteUser()";
            logExcpUIobj.ResourceName     = "UserListDAL.CS";
            logExcpUIobj.RecordId         = UserListUI.Tbl_UserId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[UserListDAL : DeleteUser] An error occured in the processing of Record Id : " + UserListUI.Tbl_UserId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }